Temporarily disable context / task switching.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Temporarily disable context / task switching.

Jump to solution
772 Views
brad_ci
Contributor II

I have a section of code (a few lines) which much not be interrupted (updating the hardware watchdog) by context/task switching. How can I tell MQX to temporarily disable task switching? I couldn't find anything in the documention, but I was sure I've seen it before...

 

Thanks,

 

Brad

0 Kudos
1 Solution
445 Views
brad_ci
Contributor II

to answer my own question:

 

_task_stop_preemption();

 

and 


_task_start_preemption();

View solution in original post

0 Kudos
2 Replies
446 Views
brad_ci
Contributor II

to answer my own question:

 

_task_stop_preemption();

 

and 


_task_start_preemption();

0 Kudos
445 Views
MarkP_
Contributor V

Should the interrupts also be disabled?

I have used:

_int_disable();
_int_enable();

 

~Mark

0 Kudos