From 005755edcdc332315ba077598d4746ac195b069e Mon Sep 17 00:00:00 2001 From: QuakeGod <QuakeGod@sina.com> Date: 星期一, 14 十月 2024 11:45:56 +0800 Subject: [PATCH] increase KPLC KBus from 2 client to 16 clients --- ComLib/Inc/MyQueue.h | 21 +++++++++++++-------- 1 files changed, 13 insertions(+), 8 deletions(-) diff --git a/ComLib/Inc/MyQueue.h b/ComLib/Inc/MyQueue.h index f070997..2b829b8 100644 --- a/ComLib/Inc/MyQueue.h +++ b/ComLib/Inc/MyQueue.h @@ -8,17 +8,22 @@ #ifndef __MYQUEUE_H__ #define __MYQUEUE_H__ +#pragma anon_unions typedef struct { unsigned char * buf1; - int Caps; - volatile int wp; //Write Pointor - volatile int rp; //Read Pointor + short Caps; + volatile short wp; //Write Pointor + volatile short rp; //Read Pointor // volatile int DataSize; - volatile int RecvBytes; - volatile int bFull; - volatile int bEmpty; - volatile int state; +// volatile short RecvBytes; + union{ + volatile unsigned char state; + struct{ + volatile unsigned char bFull:1; + volatile unsigned char bEmpty:1; + }; + }; }stMyQueue,* pMyQueue; @@ -30,7 +35,7 @@ } static __inline int GetDataLen(pMyQueue theQueue) { - int size=theQueue->wp -theQueue->rp; + int size=theQueue->wp - theQueue->rp; if (theQueue->bFull) { return theQueue->Caps; -- Gitblit v1.9.1