⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 util_critical_section.s51

📁 reference about wireless design which is helpful to everyone
💻 S51
字号:
/******************************************************************************
*                                                                             *
*        **********                                                           *
*       ************                                                          *
*      ***        ***                                                         *
*     ***    ++    ***                                                        *
*     ***   +  +   ***                      CHIPCON                           *
*     ***   +                                                                 *
*     ***   +  +   ***                                                        *
*     ***    ++    ***                                                        *
*      ***        ***                                                         *
*       ************                                                          *
*        **********                                                           *
*                                                                             *
*******************************************************************************

Filename:     flashWritePage.s51
Target:       cc2511
Author:       JOL
Revised:      24/03-2006
Revision:     1.0
******************************************************************************/
;;-----------------------------------------------------------------------------
;; See hal.h for a description of this function.
;;-----------------------------------------------------------------------------
#include "ioCC2511.h"


                MODULE  util_critical_section.s51

                RSEG    RCODE
                PUBLIC  utilEnterCriticalSection;
                FUNCTION utilEnterCriticalSection, 0203H

                ; Turn off global interrupts and return the previous state of EA
utilEnterCriticalSection:
                MOV     A, #01H;
                JBC     EA, intsTurnedOff;
                MOV     A, #00H;
intsTurnedOff:  MOV     R1, A;
                RET;


                PUBLIC  utilLeaveCriticalSection;
                FUNCTION utilLeaveCriticalSection, 0203H

                ; Restore the previous EA state from the value provided in the function parameter
utilLeaveCriticalSection:
                MOV     A, R1;
                MOV     C, ACC^0;
                MOV     EA, C;
                RET;

                END;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -