isr.c

来自「arm 2410上的hdlc server 通信程序」· C语言 代码 · 共 42 行

C
42
字号
#include<windows.h> 
#include<stdio.h> 

#include <stdarg.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include "2410addr.h"
HANDLE	m_hevInterrupt;
DWORD dwSysIntr_Keybd;

BOOL IsrThreadProc()
{
	DWORD dwPriority;

	// look for our priority in the registry -- this routine sets it to zero if
	// it can't find it.
		dwPriority = 240;	// default value is 145

    m_hevInterrupt = CreateEvent(NULL,FALSE,FALSE,NULL);
    if (m_hevInterrupt == INVALID_HANDLE_VALUE) {
    return 1;
	}
	dwSysIntr_Keybd=0x10;
	if (!InterruptInitialize(dwSysIntr_Keybd,m_hevInterrupt,NULL,0)) 
	{
    return 1;
	}


while (1)
{
	if ( WaitForSingleObject(m_hevInterrupt, INFINITE) == WAIT_TIMEOUT )
	    Uart_Printf("timeout\n");
	else
	    Uart_Printf("hdlc interrupt\n");
	InterruptDone(dwSysIntr_Keybd);
}

    return 0;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?