How to disable interrupt?

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

cross mob
Anonymous
Not applicable

I'm using Wiced-Smart SDK2.0.1.

For make some functions operate without interrupt, I'd like to control interrupt like cli/sei.

Does anybody know this?

Thank you.

1 Solution
asridharan
Employee
Employee
10 comments on KBA 5 comments on KBA First comment on KBA

See <SDK>/Wiced-Smart/bleapp/utils/bleapputils.h:

/// Disables interrupts and preemption. Use with caution; never lock out interrupts for more than ~100uS.

/// \return Returns an opaque current posture that is to be used when restoring interrupts.

UINT32 bleapputil_cpuIntDisable(void);

/// Enables/restores interrupt and preemption state.

/// \param _newPosture The value returned by bleapputil_cpuIntDisable previously.

void bleapputil_cpuIntEnable(UINT32 _newPosture);

To use:

UINT32 posture = bleapputil_cpuIntDisable();

// Interrupts and preemption are disabled now. Do something very quickly.

// Locking out interrupts for more than ~100uS may adversely affect the system.

// When done, unlock the state.

bleapputil_cpuIntEnable(posture);

View solution in original post

1 Reply
asridharan
Employee
Employee
10 comments on KBA 5 comments on KBA First comment on KBA

See <SDK>/Wiced-Smart/bleapp/utils/bleapputils.h:

/// Disables interrupts and preemption. Use with caution; never lock out interrupts for more than ~100uS.

/// \return Returns an opaque current posture that is to be used when restoring interrupts.

UINT32 bleapputil_cpuIntDisable(void);

/// Enables/restores interrupt and preemption state.

/// \param _newPosture The value returned by bleapputil_cpuIntDisable previously.

void bleapputil_cpuIntEnable(UINT32 _newPosture);

To use:

UINT32 posture = bleapputil_cpuIntDisable();

// Interrupts and preemption are disabled now. Do something very quickly.

// Locking out interrupts for more than ~100uS may adversely affect the system.

// When done, unlock the state.

bleapputil_cpuIntEnable(posture);