Preemption of functions

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
JeHu_3414236
Level 5
Level 5
10 likes received First like received

I am using the CYW20719 dev kit with WICED Studio and I have some questions regarding preemption.  I am not calling any RTOS functions.  Can any of my functions be preempted by callbacks?  When I register for interrupts like for PUART, GPIO, and timer, does the callback function preempt my function that is currently executing like the Bluetooth Management Event Handler?  I am controlling the 20719 from another processor through PUART.  Do I need to create a thread with a main loop for this type of design or is all my code already running in its own thread including interrupt callbacks?  If this is the case, is there a priority of callback execution for the interrupts or BT events?

0 Likes
1 Solution
AnjanaM_61
Moderator
Moderator
Moderator
5 comments on KBA First comment on KBA 5 questions asked

Hello,

This will be automatically taken by the ROM firmware.

BT events will be having higher priority than the application (mpaf) thread. So BT functions won't get effected because of other application interrupts.

Regards,
Anjana

View solution in original post

0 Likes
5 Replies
AnjanaM_61
Moderator
Moderator
Moderator
5 comments on KBA First comment on KBA 5 questions asked

Hello,

This will be automatically taken by the ROM firmware.

BT events will be having higher priority than the application (mpaf) thread. So BT functions won't get effected because of other application interrupts.

Regards,
Anjana

0 Likes

Thanks.  Will any of my application functions like PUART interrupt handler be preempted by the BT callback function?  I would like to disable all preemption of my application functions if possible.

0 Likes

Both the application interrupts and bluetooth management events will be taken care by the Firmware. There is expected delay in execution of interrupts because of RTOS functionalities but the application interrupt handler has guaranteed execution.

I am modifying the same global variables in the BT event handler and the PUART interrupt handler.  Do I need critical sections or mutexes to protect these variables?

0 Likes

Q) Do I need critical sections or mutexes to protect these variables?

A) No , you do not have to protect the variables.

0 Likes