1
0
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:
Karl Fessel 2022-11-03 16:20:56 +01:00
parent b61a203053
commit f3ed268ec6

View File

@ -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);
}