blob: 31f4453ed107edb76327b23d2c09135acfbcf25e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
#include "function_target.h"
#include "OS_irqHandler.h"
#include "OS_system.h"
#include "OS_thread.h"
#include "sections.h"
#pragma section DTCM begin
OSThreadQueue OSi_IrqThreadQueue = { NULL, NULL };
#pragma section DTCM end
ARM_FUNC void OS_WaitIrq(BOOL clear, OSIrqMask irqFlags)
{
OSIntrMode lastIntrMode = OS_DisableInterrupts();
if (clear)
{
OS_ClearIrqCheckFlag(irqFlags);
}
(void)OS_RestoreInterrupts(lastIntrMode);
while (!(OS_GetIrqCheckFlag() & irqFlags))
{
OS_SleepThread(&OSi_IrqThreadQueue);
}
}
|