Skip navigation.
Home
The QNX Community Portal

View topic - Changing Irq by using QNX setting?

Changing Irq by using QNX setting?

For the old QNX2 and QNX4 RTOS

Postby flagship » Fri Aug 07, 2009 12:47 pm

This code works fine with one pci serial card on computer.

memset( &isrEvent, 0, sizeof( isrEvent));
SIGEV_INTR_INIT (&isrEvent);
m_id = InterruptAttachEvent(m_irqNumber[m_boardNumber], &isrEvent, _NTO_INTR_FLAGS_END | _NTO_INTR_FLAGS_TRK_MSK);


int waitEvent() {
uint8_t myISR;

currentEvent = 0;

while (currentEvent == 0)
{
InterruptWait (0, NULL);

myISR = registerRead(REG_ISR) & 0x3F ;

switch(myISR)
{
case 0x04:
// Level 2a
currentEvent = RX_DATA_AVAILABLE;
break;
case 0x02:
// Level 3
currentEvent = TRANSMITTER_EMPTY;
break;
default:
break;
}

InterruptUnmask (m_irqNumber[m_boardNumber], m_id);
pthread_testcancel();
}

return currentEvent;
flagship
Active Member
 
Posts: 10
Joined: Wed Mar 11, 2009 8:15 pm

Postby mario » Fri Aug 07, 2009 12:57 pm

Your code doesn't CLEAR the cause of the interrupt. Where do you get m_boardNumber from? For efficiency you should loop until there are no more interrupt coming from the interrupt.
mario
QNX Master
 
Posts: 4132
Joined: Sun Sep 01, 2002 1:04 am

Postby flagship » Sat Aug 08, 2009 5:19 am

There is another function is used to enable the interrupts which is done by writing register.

initialize
unsigned int boardNumber;

ThreadCtl(_NTO_TCTL_IO,0);
itsPCISerial->getAddress();

if(itsPCISerial->boardCount <= 0)
return 0;
else
{
for (boardNumber = 0 ; boardNumber < itsPCISerial->boardCount ; boardNumber++)
{
itsPCISerial->initializeBregBase(boardNumber);
m_irqNumber[boardNumber] = itsPCISerial->boardIrq[boardNumber];
}

return itsPCISerial->boardCount;
}

open
m_boardNumber = boardNumber;
m_portNumber = portNumber;

if (m_portNumber == 0)
m_portOffset = 0x00;
else if (m_portNumber == 1)
m_portOffset = 0x08;
else
return -1;

itsPCISerial->openPort(portSettings, m_boardNumber, m_portNumber, m_portOffset);

memset( &isrEvent, 0, sizeof( isrEvent));
SIGEV_INTR_INIT (&isrEvent);
m_id = InterruptAttachEvent(m_irqNumber[m_boardNumber], &isrEvent, _NTO_INTR_FLAGS_END | _NTO_INTR_FLAGS_TRK_MSK);

wait event
int waitEvent() {
uint8_t myISR;

currentEvent = 0;

while (currentEvent == 0)
{
InterruptWait (0, NULL);

myISR = registerRead(REG_ISR) & 0x3F ;

switch(myISR)
{
case 0x04:
// Level 2a
currentEvent = RX_DATA_AVAILABLE;
break;
case 0x02:
// Level 3
currentEvent = TRANSMITTER_EMPTY;
break;
default:
break;
}

InterruptUnmask (m_irqNumber[m_boardNumber], m_id);
pthread_testcancel();
flagship
Active Member
 
Posts: 10
Joined: Wed Mar 11, 2009 8:15 pm

Postby mario » Sat Aug 08, 2009 5:13 pm

Please re-read my previous post.
mario
QNX Master
 
Posts: 4132
Joined: Sun Sep 01, 2002 1:04 am

Postby rose78 » Thu Oct 08, 2009 11:02 am

Hello, I need to know how to change Hardware IRQ's i got my brothers computer with 6 Devices on IRQ 7. how do i fix this?
thanks.

________________________________________
642-845 questions | 642-825 questions | 642-812 questions
rose78
New Member
 
Posts: 2
Joined: Thu Oct 08, 2009 10:14 am

Postby mario » Thu Oct 08, 2009 1:27 pm

This is a BIOS issue.
mario
QNX Master
 
Posts: 4132
Joined: Sun Sep 01, 2002 1:04 am

Postby Tim » Thu Oct 08, 2009 5:05 pm

Mario,

The post you answered is just a spam post :-)

Rose78 and another recent poster here all have the same links at the bottom of their posts. The auto-bot seems to be clever enough that it parses posts looking for certain buzz words/phrases in the topic and then posts 'canned' questions/answers making it look like they are real people asking questions or providing answers.

Tim
Tim
Senior Member
 
Posts: 1388
Joined: Wed Mar 10, 2004 12:28 am

Postby mario » Fri Oct 09, 2009 12:31 pm

Thanks !!!!!
mario
QNX Master
 
Posts: 4132
Joined: Sun Sep 01, 2002 1:04 am

Postby maschoen » Fri Oct 09, 2009 3:06 pm

That's very clever, to what end? Just to advertise?
maschoen
QNX Master
 
Posts: 2640
Joined: Wed Jun 25, 2003 5:18 pm

Postby Tim » Fri Oct 09, 2009 5:37 pm

Maschoen,

As far as I can tell that's the only reason. I clicked on one of the sites just to see what it was (from a QNX machine just in case) and it's just an advertizing site.

The person at the end of this thread:

http://www.openqnx.com/PNphpBB2-viewtopic-t10378-.html

is also a bot doing the same kind of advertizing using the same format. The two sites are probably related.

Tim
Tim
Senior Member
 
Posts: 1388
Joined: Wed Mar 10, 2004 12:28 am

Previous

Return to QNX2 and QNX4

Who is online

Users browsing this forum: No registered users and 3 guests