Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

protected mode interrupt handling

Status
Not open for further replies.

eelinker

Full Member level 5
Joined
Feb 12, 2006
Messages
267
Helped
16
Reputation
32
Reaction score
8
Trophy points
1,298
Location
PERSIA
Activity points
2,775
how can i handle interrupts in protected mode operation?
 

Look for 'CreateEvent' and 'WaitForSingleObject' in the msdn docs.
Here is a thread I use to get the interrupt from a usb dongle.

Code:
void __fastcall CanReceive::Execute()
  {
  HANDLE hEvent;
  
  read = write = 0;
  Priority = tpNormal;
  FreeOnTerminate = true;

  hEvent = CreateEvent(NULL, false, false, "");

  FT_SetEventNotification(ftHandle, FT_EVENT_RXCHAR, hEvent);

  while(Terminated == False)
    {
    WaitForSingleObject(hEvent, INFINITE);

    EnterCriticalSection(&Form1->CS);
    usb_Read(&RxMessage[write]);
    if(++write >= BUFFERSIZE){
    	write = 0;
      }
    LeaveCriticalSection(&Form1->CS);
    }
  }
 

    eelinker

    Points: 2
    Helpful Answer Positive Rating
btbass said:
Look for 'CreateEvent' and 'WaitForSingleObject' in the msdn docs.
Here is a thread I use to get the interrupt from a usb dongle.

Oh!
very nice code!
but i want an assembly code that runs in msdos.
a switching mechanism switches the dos to pmode
then i should handle interrupts!
Thank you again!
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top