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

📄 os.h

📁 AVR系列单片机的ADC驱动程序库
💻 H
字号:
/*********************************************************/
/*             SCHWED-OS operating system                */
/*                                                       */
/*   (C) by J鰎g Schwedes 2009, All rights reserved      */
/*********************************************************/
#ifndef OS_H
#define OS_H

#include <os_cnf.h>

/* SCHWED-OS version */
#define OS_VERSION 1010 /* OS version 1.0.1.0 */

/**************************************************************/
/* Sevices for Interrupt handling                             */

/* Caution: Each of your interrupt service routines has
   to begin with OS_BeginInt() and has to end with
   OS_EndInt() if OS_USE_INTERRUPT_NESTED_CTR is used !!!!!!! */

#ifdef OS_USE_INTERRUPT_NESTED_CTR
extern void OS_SuspendInt(void);
extern void OS_ResumeInt(void);
extern u8 OS_nested_ctr;

#define OS_BeginInt() OS_nested_ctr++
#define OS_EndInt()   OS_nested_ctr--
#else
#define OS_SuspendInt() OS_DisInt()
#define OS_ResumeInt() OS_EnaInt()

#define OS_BeginInt()
#define OS_EndInt()
#endif
/**************************************************************/
/* Sevices for Tick / Time handling                           */

extern u16 OS_GetTimeMs(void); /* get Ms ticks */

extern u16 OS_GetTimeUs(void); /* get Us ticks */

/**************************************************************/
/* Sevices for Preemptive Tasks                               */
#ifdef OS_USE_HIGH_PRIO_PREEMPTIVE_TASKS 
extern void OS_ActPreempTask(u8 task_nr);
/* Activate task with task number "task_nr (0..7max)" */
#endif
#ifdef OS_USE_HIGH_PRIO_DYNAMIC_PREEMPTIVE_TASK
extern flag OS_ActDynPreempTask(void (* function)(void));
/* Activate task with function adress "void (* function)(void)" */
/* Usage: if(OS_ActDynPreempTask(fct_name))                     */

/* return FALSE: Task buffer for dynamic Tasks is full. No execution.*/
/* return TRUE: task will be executed within 1ms                     */

#endif
#endif
/**************************************************************/
/* OS error information                                       */
#ifdef OS_USE_ERROR_TASK 
#define OS_ERROR_INT_NESTED_CTR 0x01
#define OS_ERROR_REALTIME       0x02

extern __OS_NO_INIT u8 OS_error,OS_error_cpl;
/* if error occured, root cause is saved to OS_error and complement
   in reset save RAM  */

#endif

⌨️ 快捷键说明

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