5#include "libxr_system.hpp"
15 return ErrorCode::BUSY;
22 return ErrorCode::BUSY;
42 return ErrorCode::BUSY;
ErrorCode TryLockInCallback(bool in_isr)
在回调(ISR)中尝试加锁 (Attempt to lock the mutex inside an interrupt service routine (ISR)).
libxr_mutex_handle mutex_handle_
互斥锁句柄 (Handle for the mutex).
Mutex()
构造函数,初始化互斥锁 (Constructor to initialize the mutex).
ErrorCode Lock()
加锁,如果锁已被占用,则阻塞等待 (Lock the mutex, blocking if it is already locked).
ErrorCode TryLock()
尝试加锁,如果锁已被占用,则立即返回失败 (Attempt to lock the mutex, returning immediately if already locked).
~Mutex()
析构函数,销毁互斥锁 (Destructor to destroy the mutex).
void UnlockFromCallback(bool in_isr)
在回调(ISR)中解锁 (Unlock the mutex inside an interrupt service routine (ISR)).
void Unlock()
解锁互斥锁 (Unlock the mutex).
LibXR Color Control Library / LibXR终端颜色控制库
constexpr auto min(T1 a, T2 b) -> typename std::common_type< T1, T2 >::type
计算两个数的最小值