rtos.h
来自「ucos2.85在vs2005上模拟环境」· C头文件 代码 · 共 45 行
H
45 行
#ifndef __RTOS_H__
#define __RTOS_H__
#include "includes.h"
typedef void (*task)(void *p_arg);
#ifdef __cplusplus
extern "C" {
#endif
RTOS_Thread create_thread(task func, void *arg, u8 prio, void *stack, u32 size);
//mutex api
RTOS_Mutex RTOS_MutexCreate( void );
void RTOS_MutexDestroy( RTOS_Mutex mutex );
int RTOS_MutexLock( RTOS_Mutex mutex, bool suspend );
int RTOS_MutexLockTimeout( RTOS_Mutex mutex, INT16U msecs );
int RTOS_MutexUnlock( RTOS_Mutex mutex );
//mailbox api
RTOS_Mailbox RTOS_MailboxCreate( RTOS_Message message );
int RTOS_MailboxDestroy( RTOS_Mailbox mailbox );
RTOS_Message RTOS_MailboxQuery( RTOS_Mailbox mailbox );
RTOS_Message RTOS_MailboxWait( RTOS_Mailbox mailbox, bool suspend );
RTOS_Message RTOS_MailboxWaitTimeout( RTOS_Mailbox mailbox, INT16U msecs );
int RTOS_MailboxSend( RTOS_Mailbox mailbox, RTOS_Message message );
//sem api
RTOS_Semaphore RTOS_SemaphoreCreate( U32 init );
int RTOS_SemaphoreDestroy( RTOS_Semaphore semaphore );
int RTOS_SemaphoreQuery( RTOS_Semaphore semaphore );
int RTOS_SemaphoreWait( RTOS_Semaphore semaphore, bool suspend );
int RTOS_SemaphoreWaitTimeout( RTOS_Semaphore semaphore, INT16U msecs );
int RTOS_SemaphoreRelease( RTOS_Semaphore semaphore );
void sem_lock(RTOS_Semaphore semaphore );
void sem_unlock(RTOS_Semaphore semaphore );
#ifdef __cplusplus
}
#endif
#endif //__RTOS_H__
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?