亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? os.h

?? MINI-os code,you can download !
?? H
字號:
/*********************************************************************************************************
**												   Mini OS
**                                   The Real-Time Kernel For Avr Atmega8/16 CPU
**
**                                  (c) Copyright 2004-2004, wanghong
**                                           All Rights Reserved
**
**                                                  V1.20
**
**
** Filename: os.h
** Created by: wanghong
** Date: 2004.09.05
** Description: Mini OS for Avr Atmega8/16 CPU
**
**------------------------------------------------------------------------------------------------------
** Modified by:
** Date:
** Description:
**
**------------------------------------------------------------------------------------------------------
********************************************************************************************************/
#ifndef _OS_H_
#define _OS_H_


#include "..\os\os_config.h"

#include <iom8v.h>
#include <macros.h>
#include <string.h>


/*-- to disable/enable the maskable interrupts --*/
#define		OS_ENTER_CRITICAL()		do {CLI();}while(0)
#define		OS_EXIT_CRITICAL()		do {SEI();}while(0)

#define	NULL	(void *)0

//; bit-mapped signal definitions
#define	BIT0			(1<<0)
#define	BIT1			(1<<1)
#define	BIT2			(1<<2)
#define	BIT3			(1<<3)
#define	BIT4			(1<<4)
#define	BIT5			(1<<5)
#define	BIT6			(1<<6)
#define	BIT7			(1<<7)
#define	BIT8			(1<<8)
#define	BIT9			(1<<9)
#define	BIT10			(1<<10)
#define	BIT11			(1<<11)
#define	BIT12			(1<<12)
#define	BIT13			(1<<13)
#define	BIT14			(1<<14)
#define	BIT15			(1<<15)

//; byte mask definitions
#define	K_SIG			1				// wait for signal
#define	K_TMO			2				// wait for time out
#define	EVENT_SIG		4				// signal event
#define	EVENT_TMO		8				// time out or interval time out event
#define	K_READY			16				// flag indicates task status: 1, task ready, 0, task is not ready
#define	K_ACTIVE		32				// flag indicates task status: 1, task actived, 0, task has not been created
#define	K_MSG			64				// wait for message
#define	EVENT_MSG		64				// message received event
#define	K_IVL			128  			// not a task state bit; only used in os_wait
#define	NOT_OK			128				// parameter err
#define	EVENT_NONE		0				// no event

//; error macros definitions
#define	ERR_NONE		0				// ok
#define	ERR_MSG_NONE	-1				// no message err
#define	ERR_MSG_OVF		-2				// message pool overflow
#define	ERR_MSG_GENERAL	-3				// task busy or can not receive message


typedef	unsigned int	SIGNAL_TYPE;

//; data structure define for task status
typedef struct	{
	unsigned int	waitsig		:1;		// wait for signal
	unsigned int	waitto		:1;		// wait for time out
	unsigned int	sigflag		:1;		// signal flag
	unsigned int	toflag		:1;		// time out flag
	unsigned int	ready		:1;		// task ready(wait for running)
	unsigned int	active		:1;		// task active(enable with os_create_task)
	unsigned int	waitmsg		:1;		// wait for message, can not be clear once set to '1'
	unsigned int	rdy			:1;		// RDY flag

}OS_TASK_STATUS;

//; data structure define for message
typedef struct	{
	unsigned char	task_id;			// notify task id
	unsigned char	msg[3];				// message data

}OS_MSG;



/**********************************************************
 *  os_create_task: starts the defined task function using
 *		the task number specified by task_id. The task is
 *		marked as ready and is ready to execute
 *
 *  @param task_id: task id
 *  @param ptask_entry: task entry address
 *  @return 0: task create successfully,
 *			0xff: task could not be started or if no task
 *				was defined using the specified task number
 **********************************************************/
unsigned char os_create_task (unsigned char task_id, void (*task_entry)(void));

/**********************************************************
 *  os_wait: halts the current task and waits for one or
 *		several events such as a time interval, a time-out, a message,
 *		or a bit-mapped signal from another task or interrupt.
 *
 *  @param typ: event or events to wait for and can be any
 *				combination of the following manifest constants:
 *				(K_TMO, K_SIG, K_MSG).
 *	@param timeout: the number of timer ticks to wait for an
 *				interval event (K_IVL) or a time-out event (K_TMO).
 *	@param dummy: not used.
 *
 *  @return EVENT_SIG: A signal was received.
 *			EVENT_MSG: A message was received.
 *			EVENT_TMO: A time-out has completed or an interval
 *						has expired.
 *			NOT_OK: The value of the typ argument is invalid.
 **********************************************************/
unsigned char os_wait (unsigned char typ, unsigned char timeout, unsigned int dummy);

/**********************************************************
 *  isr_send_signal: sends a bit-mapped signal to task task_id. If the
 *		specified task is already waiting for a signal,	this
 *		function call readies the task for execution. Otherwise,
 *		the signal is stored in the signal flag of the task.
 *		The isr_send_signal function may be called only from interrupt service routine.
 *
 *  @param task_id: task id
 *  @param signal: bit-mapped signal
 *  @return 0: if successful,
 *			0xff: signal invalid or the specified task does not exist.
 **********************************************************/
//#pragma	NO_OVERLAP
unsigned char isr_send_signal (unsigned char task_id, SIGNAL_TYPE signal);

/**********************************************************
 *  os_send_signal: sends a bit-mapped signal to task task_id. If the
 *		specified task is already waiting for a signal,	this
 *		function call readies the task for execution. Otherwise,
 *		the signal is stored in the signal flag of the task.
 *		The os_send_signal function may be called only from task functions.
 *
 *  @param task_id: task id
 *  @param signal: bit-mapped signal
 *  @return 0: if successful,
 *			0xff: signal invalid or the specified task does not exist.
 **********************************************************/
unsigned char os_send_signal (unsigned char task_id, SIGNAL_TYPE signal);

/**********************************************************
 *  os_get_signal: get a bit-mapped signal of the current task.
 *		This function may be called only from task functions.
 *
 *  @param none
 *  @return: bit-mapped signal
 *			0: no signal or the specified task does not exist.
 **********************************************************/
SIGNAL_TYPE os_get_signal (void);

/**********************************************************
 *  os_clear_signal: clear a bit-mapped signal of the current task.
 *		This function may be called only from task functions.
 *
 *  @param signal: bit-mapped signal
 *  @return 0: if successful,
 *			0xff: the specified task does not exist.
 **********************************************************/
unsigned char os_clear_signal (SIGNAL_TYPE signal);


/**********************************************************
 *  isr_send_message: send a message to a specific task.
 *		This function may be called only from interrupt service routine.
 *
 *  @param task_id: the specified task to receive the message.
 *  @param msg_data: data to be sent. msg_data lenght must be 3  bytes.
 *  @return 0: if successful,
 *			!0: error code.
 **********************************************************/
//#pragma	NO_OVERLAP
unsigned char isr_send_message (unsigned char task_id, unsigned char *msg_data);

/**********************************************************
 *  os_send_message: send a message to a specific task.
 *		This function may be called only from task functions.
 *
 *  @param task_id: the specified task to receive the message.
 *  @param msg_data: data to be sent. msg_data lenght must be 3  bytes.
 *  @return 0: if successful,
 *			!0: error code.
 **********************************************************/
unsigned char os_send_message (unsigned char task_id, unsigned char *msg_data);

#if OS_MSG_PRIORITY_EN
/**********************************************************
 *  os_send_message_front: send a message to a specific task. The message is posted at
 *			the front instead of the end of the queue, using os_send_message_front()
 *			allows you to send 'priority' messages.
 *		This function may be called only from task functions.
 *
 *  @param task_id: the specified task to receive the message.
 *  @param msg_data: data to be sent. msg_data lenght must be 3  bytes.
 *  @return 0: if successful,
 *			!0: error code.
 **********************************************************/
unsigned char os_send_message_front (unsigned char task_id, unsigned char *msg_data);
#else
#define	os_send_message_front(task_id, msg_data)	os_send_message(task_id, msg_data)
#endif

/**********************************************************
 *  os_get_message: get a message to task's message queue.
 *		This function may be called only from task functions.
 *
 *  @param msg_buf: the buffer to receive the message. buffer lenght must be 3 bytes.
 *  @return >=0: number of unread msg still in the task's message queue,
 *			-1: no message.
 **********************************************************/
char os_get_message (unsigned char *msg_buf);

/**********************************************************
 *  os_running_task_id: determines the task id of the task currently executing.
 *
 *  @param none
 *  @return 0: function returns the task ID of the task currently executing.
 *		This value is a number in the range 0-15.
 **********************************************************/
unsigned char os_running_task_id (void);

/**********************************************************
 *  os_switch_task: The os_switch_task function allows a task to give up
 *		the CPU and allow another task run. If the task calling os_switch_task
 *		is the only task ready for execution it resumes running immediately.
 *
 *  @param none
 *  @return none
 **********************************************************/
unsigned char os_switch_task (void);

/**********************************************************
 *  os_reset_interval: The os_reset_interval function is used to correct timer
 *		problems that occur when the os_wait function is used to wait for
 *		K_IVL and K_SIG events simultaneously. In such a case, if a signal
 *		(K_SIG) event causes os_wait to exit, the interval timer is not adjusted
 *		and subsequent calls to os_wait to wait for an interval may not delay
 *		for the required time period. The os_reset_interval allows you to reset
 *		the interval timer in such an event.
 *
 *  @param ticks: number of timer ticks
 *  @return none
 **********************************************************/
void os_reset_interval (unsigned char ticks);

/**********************************************************
 *  os_time_get: This function is used by your application to obtain the current value of the 32-bit
 *						counter which keeps track of the number of clock ticks.
 *
 *  @param none
 *  @return: The current value of os_time.
 **********************************************************/
unsigned long os_time_get (void);

/**********************************************************
 *  os_time_set: This function sets the 32-bit counter which keeps track of the number of clock ticks.
 *
 *  @param ticks: specifies the new value that os_time needs to take.
 *  @return: none.
 **********************************************************/
void os_time_set (unsigned long ticks);

#if OS_STK_CHK_EN
/*********************************************************************************************************
*                                             STACK CHECKING
*
*	os_get_stack_usage: This function is called to get the max usage of system stack.
*
*	@param: prio, not used
*	@return: the max usage of stack in %
*********************************************************************************************************/
unsigned char os_get_stack_usage (unsigned char prio);
#endif

/**********************************************************
 *  os_init: os startup routine, init for Mini OS
 *
 *  @param none
 *  @return none
 **********************************************************/
void os_init (void);

#if OS_CPU_HOOKS_EN
/*********************************************************************************************************
*                                           TASK SWITCH HOOK
*
*	os_task_sw_hook: This function is called when a task switch is performed.  This allows you to perform other
*						operations during a context switch.
*
*	@param: none
*	@return: none
*
*********************************************************************************************************/
void os_task_sw_hook (void);

/*********************************************************************************************************
*                                           STATISTIC TASK HOOK
*
*	os_task_stat_hook: This function is called every second by Mini OS's statistics task.  This allows your
*						application to add functionality to the statistics task.
*
*	@param: none
*	@return: none
*********************************************************************************************************/
void os_task_stat_hook (void);

/*********************************************************************************************************
*                                               TICK HOOK
*
*	os_time_tick_hook: This function is called every tick.
*
*	@param: none
*	@return: none
*
*	Note(s): 1) Interrupts may or may not be ENABLED during this call.
*********************************************************************************************************/
void os_time_tick_hook (void);
#endif



#endif


/************************************************
 * @ os.h v1.0 log @
 *
 * Revision 1.0.0.0     Wanghong    2004/09/05
 * create file
 *
 * Revision 1.2.0.0     Wanghong    2005/12/17
 * added bit-mapped signal interface function prototype,
 * added os message interface prototype.
 *
 ***********************************************/

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产在线精品免费av| 天涯成人国产亚洲精品一区av| 亚洲18影院在线观看| 欧美精品777| 国产乱子轮精品视频| 日韩三级在线免费观看| 国产在线视频精品一区| 国产精品国产自产拍高清av| 91丨九色porny丨蝌蚪| 亚洲黄色录像片| 久久久国际精品| av不卡在线播放| 三级成人在线视频| 日本一区免费视频| 在线播放中文字幕一区| 3atv在线一区二区三区| 成人av在线影院| 蜜桃在线一区二区三区| 亚洲欧美视频在线观看| 精品国产精品网麻豆系列| av毛片久久久久**hd| 欧美在线观看一区二区| 国产综合一区二区| 岛国av在线一区| 久久99久国产精品黄毛片色诱| 亚洲尤物视频在线| 国产精品视频一二| 久久综合一区二区| 日韩精品一区二区三区中文精品 | 91丨porny丨最新| 在线免费一区三区| 日韩无一区二区| 国产精品每日更新| 午夜精品福利在线| 国产成人av资源| 狠狠色狠狠色综合系列| 99这里只有精品| 日韩欧美一二三四区| 成人欧美一区二区三区在线播放| 日韩久久精品一区| 国产精品超碰97尤物18| 日本午夜一本久久久综合| 午夜精品在线看| 成人高清在线视频| 欧美一区二区三区系列电影| 欧美日韩在线播放三区四区| 欧美羞羞免费网站| 欧美性一区二区| 国产亚洲欧美一级| 国产色91在线| 人人精品人人爱| 久久99精品久久久久| 欧美在线视频日韩| 26uuu精品一区二区| 91猫先生在线| 国模冰冰炮一区二区| 欧美在线三级电影| 国产精品嫩草影院com| 乱中年女人伦av一区二区| 日韩精品一级中文字幕精品视频免费观看 | 国产成人午夜精品5599| 制服丝袜亚洲色图| 亚洲精品视频一区二区| 国产精品一二三区在线| 欧美一级片在线观看| 亚洲成人中文在线| 成人高清在线视频| 国产日韩欧美精品电影三级在线| 美腿丝袜亚洲三区| 91精品国产综合久久精品图片| 亚洲美女视频在线观看| 不卡一区二区三区四区| 久久久精品免费网站| 国内外精品视频| 精品剧情v国产在线观看在线| 国产午夜亚洲精品不卡| 免费亚洲电影在线| 日韩一区国产二区欧美三区| 日韩电影在线免费| 日韩欧美一级精品久久| 免费看黄色91| 欧美精品一区二区三区久久久| 日韩电影在线一区| 精品欧美黑人一区二区三区| 免费xxxx性欧美18vr| 欧美成人官网二区| 国产在线观看一区二区| 国产日韩欧美综合一区| 成人精品国产福利| 亚洲精品一二三| 欧美群妇大交群中文字幕| 欧美精品一区二区久久久| 精品一区二区三区在线播放| 久久精品一区二区三区av| 国产不卡在线播放| 日韩无一区二区| 国产麻豆精品在线| 国产精品国产三级国产普通话99 | 在线综合+亚洲+欧美中文字幕| 精品一区二区免费在线观看| 日韩女优电影在线观看| 国产九色sp调教91| 亚洲日本一区二区| 九九热在线视频观看这里只有精品| 日韩欧美国产综合一区| 粉嫩av一区二区三区| 亚洲制服欧美中文字幕中文字幕| 欧美疯狂做受xxxx富婆| 国产精品中文字幕一区二区三区| 综合激情成人伊人| 欧美久久久久久蜜桃| 国产91丝袜在线播放九色| 艳妇臀荡乳欲伦亚洲一区| av在线一区二区三区| 日日摸夜夜添夜夜添亚洲女人| 精品国产乱码久久久久久久| 91免费看视频| 九色porny丨国产精品| 亚洲激情av在线| 久久久久久久久一| 欧美日韩一区二区欧美激情| 国产精品自拍一区| 天堂av在线一区| 国产精品国产精品国产专区不片| 91精品国产高清一区二区三区蜜臀| 国产盗摄精品一区二区三区在线| 亚洲一二三四久久| 91久久国产最好的精华液| 日韩一区有码在线| 精品久久人人做人人爽| 91高清视频免费看| 懂色av一区二区三区免费看| 免费av网站大全久久| 亚洲午夜久久久久久久久电影网| 国产亚洲福利社区一区| 91麻豆精品国产综合久久久久久| 91丨九色porny丨蝌蚪| 国产成人精品免费一区二区| 免费一级片91| 日韩国产精品久久| 亚洲国产人成综合网站| 亚洲区小说区图片区qvod| 国产三级三级三级精品8ⅰ区| 欧美成人一级视频| 欧美另类变人与禽xxxxx| 91视频在线观看| 91在线观看美女| 成人激情午夜影院| 成人永久aaa| 成人精品小蝌蚪| 成人午夜视频福利| 国产91在线观看丝袜| 国产成人一级电影| 国产成人精品免费在线| 成人午夜视频在线观看| 成人中文字幕电影| jlzzjlzz亚洲日本少妇| eeuss鲁片一区二区三区在线观看| 国产精品一区二区三区四区 | 精品国产a毛片| 亚洲精品在线观| 26uuu精品一区二区| 国产天堂亚洲国产碰碰| 中文在线资源观看网站视频免费不卡 | 国产乱码精品一区二区三区忘忧草 | 日本高清视频一区二区| 色综合天天综合色综合av | 538prom精品视频线放| 91精品国产欧美一区二区| 欧美一区二区三区四区视频 | 99久久亚洲一区二区三区青草| 视频一区二区三区入口| 日日夜夜一区二区| 99久久免费国产| 欧美性受xxxx| 7777精品伊人久久久大香线蕉| 56国语精品自产拍在线观看| 久久综合一区二区| 亚洲三级免费电影| 日韩影院免费视频| 国产精品正在播放| 日本高清免费不卡视频| 在线成人午夜影院| 久久精品夜色噜噜亚洲a∨| 亚洲女同女同女同女同女同69| 午夜影视日本亚洲欧洲精品| 国产麻豆9l精品三级站| 91免费版在线看| 日韩女优av电影| 亚洲视频免费在线| 人人狠狠综合久久亚洲| 成人午夜在线免费| 69堂亚洲精品首页| 国产精品久久久一区麻豆最新章节| 依依成人精品视频| 国产麻豆一精品一av一免费| 欧美性生交片4| 中文字幕成人网| 狠狠狠色丁香婷婷综合久久五月| 91丝袜高跟美女视频|