📄 os.h
字号:
/****h* DE9901/os.h
* COPYRIGHT
* (c) 2004-2005 Mobitex Technology AB - All rights reserved
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* * 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* * 3. The name Mobitex Technology AB may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY MOBITEX TECHNOLOGY AB "AS IS" AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
* SHALL MOBITEX TECHNOLOGY AB BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* AUTHOR
* MPN/Kjell Westerberg
* HISTORY
* Changes in the file are recorded in this list.
* Ver: Date: Responsible: Comment:
* R1A01 2005-01-17 Kjell Westerberg Approved.
* R1A02 2005-02-07 Kjell Westerberg Changed prio for CMX and BINIO interrupts.
* R1A04 2005-02-28 Kjell Westerberg Increased priority of CMX interrupt.
* DESCRIPTION
* This is a collection of functions to access some OS functions.
***/
#ifndef _OS_H
#define _OS_H
/* Disable/enable all interrupts. */
#define DISABLE_INTERRUPTS cyg_interrupt_disable
#define ENABLE_INTERRUPTS cyg_interrupt_enable
/* Stops the scheduler. No DSR or thread changes can take place. */
#define DISABLE_THREADS cyg_scheduler_lock
#define ENABLE_THREADS cyg_scheduler_unlock
/* We define an own type for the OS tick count. */
typedef cyg_tick_count_t OSTICK;
/* We can use a special function to always get the OSTICK in ms. Even if we change the clock */
/* interrupt source to something else than 1000 Hz. */
#define MS_PER_OSTICK (1000/CYGNUM_HAL_RTC_DENOMINATOR)
OSTICK OS_GetTicks(void);
/* ISR priority, highest priority with the highest value. */
/* The RTC has a priority of 2 in the Mobitex version of eCos. */
/* The serial ports has a priority of 4. */
#define CMX_ISR_PRIO 5
#define BINIO_ISR_PRIO 1
/* Thread priorities: high priority with low value. */
#define TCL_THREAD_PRIO 25
#define PRINT_THREAD_PRIO 29
#define MAIN_THREAD_PRIO 2
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -