CException in ChibiOS

This forum is dedicated to feedback, discussions about ongoing or future developments, ideas and suggestions regarding the ChibiOS projects are welcome. This forum is NOT for support.
Post Reply
akshaim
Posts: 20
Joined: Tue Sep 21, 2021 9:47 am
Has thanked: 9 times

CException in ChibiOS

Post 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
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: CException in ChibiOS

Post 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
Post Reply