//--------------------------------------------------------------------------- #include #pragma hdrstop #include #include "IRQMThrd.h" #include "IRQMSmpc.h" #include "W32IRQM.h" #include "ACCES32.h" #pragma package(smart_init) //--------------------------------------------------------------------------- __fastcall TIRQThread::TIRQThread(bool CreateSuspended) : TThread(CreateSuspended) { } //--------------------------------------------------------------------------- void __fastcall TIRQThread::UpdateIRQCaption(void) { Form1->CountLabel->Caption = "IRQ " + IntToStr(IRQ) + " Count: " + IntToStr(IRQCount); Form1->LastIRQLabel->Caption = "Last IRQ: " + IntToStr(IRQ); } //--------------------------------------------------------------------------- void __fastcall TIRQThread::UpdateStatusCaption(void) { Form1->StatusLabel->Caption = "Waiting...Generate IRQs now"; } //--------------------------------------------------------------------------- void __fastcall TIRQThread::Execute() { bool IRQOccurred; Synchronize(UpdateStatusCaption); do { IRQOccurred = DetectIRQ(IRQ); if (IRQOccurred) { IRQCount++; // send eoi SendEOI(IRQ); Synchronize(UpdateIRQCaption); } } while (!Terminated); } //---------------------------------------------------------------------------