X
RSS YouTube LinkedIn Twitter XCore IRC

Search




Post new topic Reply to topic   [ 3 posts ] 
Author Message
PostPosted: Fri Apr 27, 2012 8:02 am 
Joined: Fri Nov 11, 2011 9:57 am
Posts: 14
hi:
Do somebody write interrupt/exception handler?
Or Is the interrupt/exception not available for users?

By the way, I see UART code in http://github.xcore.com/sc_uart/generic.html
In the uart_rx_impl.xc, there is a function

static inline void trap()
{
asm("ecallf %0" : : "r"(0));
}

how do trap() work?

Thanks for hacker!


Top
Offline Profile View all posts by this user  
 
PostPosted: Fri Apr 27, 2012 3:40 pm 
User avatar
XMOS Employee
Joined: Thu Dec 10, 2009 9:20 pm
Posts: 326
Trap() isn't a exception-handler in this case, but a function that raises one.


Top
Offline Profile View all posts by this user  
 
PostPosted: Fri Apr 27, 2012 6:31 pm 
User avatar
XCore Moderator
Joined: Thu Dec 10, 2009 6:56 pm
Posts: 545
Hi porsche,

For writing an exception handler, see: https://www.xcore.com/forum/viewtopic.php?f=26&t=626

For writing an interrupt handler see the timer interrupt implementation of my project FreeRTOS port, the file FreeRTOS\Source\portable\XCC\XMOS_XS1\port_asm.S file contains the handler (clock_int_), and the setup is done in init_system_.
The timer itself is declared in port_xc.xc. This should get you started.


Top
Offline Profile View all posts by this user  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic   [ 3 posts ] 


Who is online

Users browsing this forum: No registered users and 1 guest



Search for:
Jump to: