1 Reply Latest reply on Jul 17, 2014 10:33 AM by ArvindS_76

    How to disable interrupt?

      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. Re: How to disable interrupt?

          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.


          1 of 1 people found this helpful