Page 1 of 1

CException in ChibiOS

Posted: Wed Aug 10, 2022 1:52 pm
by akshaim
Hi Forum,

I am trying to use CException library in Chibi OS application to implement the " try, throw and catch " pattern. Have anyone tried this? The library seems to be compact and offers multithreading support as well. Is there a reason why we are not using it in Chibi OS? Are ``setjmp`` and ``longjmp`` prohibited in ChibiOS?

Regards,

Akshai

Re: CException in ChibiOS

Posted: Wed Aug 10, 2022 5:52 pm
by Giovanni
Hi,

It should be possible but do not mix setjmp and longjmp between threads or things will get complex. Also, do not jump in and out of critical sections and ISRs. Only do that in the same "context".

Giovanni