Notes on using lib_trycatch

Technical questions regarding the XTC tools and programming with XMOS.
Post Reply
User avatar
johned
XCore Addict
Posts: 185
Joined: Tue Mar 26, 2013 12:10 pm
Contact:

Notes on using lib_trycatch

Post by johned »

The XMOS Try/Catch library https://www.xmos.com/support/libraries/lib_trycatch can be used to catch exceptions.

Handling exceptions correctly avoids the core sitting in the trap handler.

Example of catching an application thrown exception: https://github.com/xmos/lib_trycatch/bl ... rc/main.xc

Example of catching a hardware exception:
https://github.com/xmos/lib_trycatch/bl ... rc/main.xc

The limitation is that lib_trycatch won’t attempt to free any resources allocated inside the try block or return any variables to their original state in the event of an exception being raised. See https://github.com/xmos/lib_trycatch/bl ... README.rst for more details.


User avatar
andrew
Experienced Member
Posts: 114
Joined: Fri Dec 11, 2009 10:22 am

Post by andrew »

Thanks John
Post Reply