cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Anonymous
Not applicable
3,794 Views

Why can't disable interrupt of microblaze?

Jump to solution

I am using interrupt of microblze to capture an external interrupt with out interrupt controller, my c language codes are as below.

 

When an interrupt come, a * is printed.

after 10 *, it is expected that interrupt be disabled and nothing printed.

 

But things is different, it seemed that interrupt can't be disabled

 

 

(EDK 10.1.3)

 

#include "xparameters.h"
#include "stdio.h"
//====================================================
int i=0;int


XInterruptHandler my_handler(void)
{
 if(i==10) {print("=");}
 else{print("*");i++; }
 //return 0;
}

 

int main (void)
{
 XStatus status;
 void * DataPtr;

 

 microblaze_register_handler(my_handler,&DataPtr);
 microblaze_enable_interrupts();

 

 while(1)
 {
    if(i==10)
    {
        microblaze_disable_interrupts();
    }
  }

return 0;
}

 

 

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Anonymous
Not applicable
4,512 Views

Re: Why can't disable interrupt of microblaze?

Jump to solution
Yes! powerful volatile.

View solution in original post

0 Kudos
2 Replies
Highlighted
Xilinx Employee
Xilinx Employee
3,777 Views
Registered: ‎04-23-2008

Re: Why can't disable interrupt of microblaze?

Jump to solution

Your global variable should be declared as 'volatile'

 

-Brian

0 Kudos
Highlighted
Anonymous
Not applicable
4,513 Views

Re: Why can't disable interrupt of microblaze?

Jump to solution
Yes! powerful volatile.

View solution in original post

0 Kudos