- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello, I am fairly new to writing ISRs and handling interrupts for the Nios processor.
Here is a brief intro to what I'm trying to do and what is already working: I have created my own ISR in order to receive data from another device connected by UART. I would like to be able to write to that device as well. So far, if I enable interrupts and register my handler, I can no longer use fprintf or fwrite to send data back to that device. I would like to be able to nonetheless...what can I do? My ISR:
volatile int uart_capture;
void uart_handle(void *context){
unsigned short int data,status;
volatile int* uart_ptr = (volatile int*) context;
status = IORD_ALTERA_AVALON_UART_STATUS(BLUETOOTH_BASE);
while (!(status & ALTERA_AVALON_UART_STATUS_RRDY_MSK))
status = IORD_ALTERA_AVALON_UART_STATUS(BLUETOOTH_BASE);
data = IORD_ALTERA_AVALON_UART_RXDATA(BLUETOOTH_BASE);
*uart_ptr = IORD_ALTERA_AVALON_UART_RXDATA(BLUETOOTH_BASE);
IOWR_ALTERA_AVALON_UART_STATUS(BLUETOOTH_BASE, 0x0);
IORD_ALTERA_AVALON_UART_RXDATA(BLUETOOTH_BASE);
}
Link Copied
0 Replies
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page