📄 ar_lib.c
字号:
/*----------------------------------------------------------------------------
* A R T X - K e r n e l
*----------------------------------------------------------------------------
* Name: AR_LIB.C
* Purpose: Library of interrupt protected functions
* Rev.: V2.00 / 19-oct-2005
*----------------------------------------------------------------------------
* This code is part of the ARTX-ARM kernel package of Keil Software.
* Copyright (c) 2004-2005 Keil Software. All rights reserved.
*---------------------------------------------------------------------------*/
#include "Kernel\ARTX_Config.h"
#include "Kernel\AR_Lib.h"
/*----------------------------------------------------------------------------
* Functions
*---------------------------------------------------------------------------*/
/*--------------------------- _andw -----------------------------------------*/
void _andw (U16 *fptr, U16 mask) __swi (1) {
/* A protected function to clear event flags. */
*fptr &= mask;
}
/*--------------------------- _orw ------------------------------------------*/
void _orw (U16 *fptr, U16 mask) __swi (2) {
/* A protected function to set event flags. */
*fptr |= mask;
}
/*--------------------------- _incw -----------------------------------------*/
void _incw (U16 *fptr) __swi (3) {
/* A protected function to increment a 16-bit variable. */
*fptr += 1;
}
/*--------------------------- _decw -----------------------------------------*/
void _decw (U16 *fptr) __swi (4) {
/* A protected function to decrement a 16-bit variable. */
*fptr -= 1;
}
/*--------------------------- _inc16 ----------------------------------------*/
void _inc16 (U16 *idx) __swi (5) {
/* Protected function to increment queue index. */
*idx = (*idx + 1) & 0x0F;
}
/*--------------------------- _test_bool ------------------------------------*/
#pragma warning disable = 135 /* Disable 'no return value' warning */
BOOL tstclrb (BIT *bp) __arm {
/* Protected function to return a variable value and clear it to 0. */
__asm {
MOV R1,#0
SWPB R0,R1,[bp]
}
}
/*----------------------------------------------------------------------------
* end of file
*---------------------------------------------------------------------------*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -