📄 easyirqsample.cpp
字号:
#include <windows.h>
#include <conio.h>
#include "easyirq.h"
// the function that is called every IRQ
void __stdcall irqHandler(DWORD irqNum) {
MessageBox(0, "IRQ here !", "", 0);
}
int PASCAL WinMain (HANDLE hInstance, HANDLE hPrevInstance, LPSTR lpszCmdParam, int nCmdShow) {
// turn on IRQ 7 handling
if ( easyIrq(7, TRUE, &irqHandler) ) {
MessageBox(0, "some error", "error", 0);
return 1;
}
// enable printer port interrupts (transition of the Ack signal on pin 10 of the 25-pin connector)
_outp(0x378 + 2, 16);
// just wait irqs
MessageBox(0, "click OK to finish", "", 0);
// disable printer port interrupts
_outp(0x378 + 2, 0);
// turn off IRQ 7 handling (mask irq)
easyIrq(7, FALSE, &irqHandler);
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -