|
修改好了,先列出新的 头文件,检查一下
新的 公共函数库 有5个源文件- #ifndef _DELAY_
- #define _DELAY_
- void Nopdelay(U32 delay);
- void Delay(U32 delay);
- #endif
- // end of file -----------------------------------------------------------------
复制代码- #ifndef _DATA_CONVERT_
- #define _DATA_CONVERT_
- #include "typedef.h"
- int Split_4_Byte(U32 sub,U8 *Buffer);
- int Combine_4_Byte(U32 *Result,U8 *Buffer);
- int Split_2_Byte(U16 sub,U8 *Buffer);
- int Combine_2_Byte(U16 *Result,U8 *Buffer);
- #endif
- // end of file -----------------------------------------------------------------
复制代码- #ifndef _ASYN_TIMER_
- #define _ASYN_TIMER_
- #include "typedef.h"
- #include "CommonMacro.h"
- void RunTimer(U32 *AsynTimer);
- void ClearTimer(U32 *AsynTimer);
- U8 IsTimeout(U32 AsynTimer,U32 MaxTimeout);
- U8 IsMaxTimeout(U32 *Timer,U32 MaxTime);
- U8 IsStatusTimeout(U8 LogicFlag,U32 *Timer,U32 MaxTime);
-
- #endif
- // end of file -----------------------------------------------------------------
复制代码- #ifndef _BUFFER_UTIL_
- #define _BUFFER_UTIL_
- #include "typedef.h"
- int Buffer_Copy(U8 *dest,U8 *source,U8 length);
- int Buffer_Clear(U8 *buffer,U8 length);
- int Buffer_Joint(U8 *dest,U8 *source,U16 start,U8 length);
- #endif
- // end of file -----------------------------------------------------------------
复制代码- #ifndef _RECV_TIMEOUT_
- #define _RECV_TIMEOUT_
- #include "typedef.h"
- typedef struct
- {
- U32 Timer;
- U8 RecvLen;
- U8 CurrentLen;
- U8 RecvBuff[250];
- }TimeoutStr;
- int recvBuffer(TimeoutStr *Str,U8 *buffer,U8 len);
- int recvByte(TimeoutStr *Str,U8 Data);
- int IsRecvTimeout(TimeoutStr *Str,U32 nTimeoutMs) ;
- //==============================================================================
- int recvTimeoutData(TimeoutStr *Str,U8 *Buf,U32 Timeout);
- #endif
- // end of file -----------------------------------------------------------------
复制代码 |
|