aboutsummaryrefslogtreecommitdiff
path: root/AT91SAM7S256/Source/d_bt.r
diff options
context:
space:
mode:
Diffstat (limited to 'AT91SAM7S256/Source/d_bt.r')
-rw-r--r--AT91SAM7S256/Source/d_bt.r26
1 files changed, 19 insertions, 7 deletions
diff --git a/AT91SAM7S256/Source/d_bt.r b/AT91SAM7S256/Source/d_bt.r
index 8c9558f..76c079b 100644
--- a/AT91SAM7S256/Source/d_bt.r
+++ b/AT91SAM7S256/Source/d_bt.r
@@ -138,18 +138,25 @@ static UWORD RemainingLength;
*AT91C_PIOA_CODR = BT_RST_PIN; /* PA11 set output low */\
}
-#define BTInitReceiver(InputBuffer, Mode)\
+#define BTInitReceiver(InputBuffer, Mode, noLenBytes)\
{\
pBuffer = InputBuffer;\
MsgIn = 0;\
FullRxLength = 0;\
- if (STREAM_MODE == Mode)\
+ if (noLenBytes)\
{\
- LengthSize = 2;\
+ LengthSize = 0;\
}\
else\
{\
- LengthSize = 1;\
+ if (STREAM_MODE == Mode)\
+ {\
+ LengthSize = 2;\
+ }\
+ else\
+ {\
+ LengthSize = 1;\
+ }\
}\
}
@@ -200,7 +207,7 @@ static UWORD RemainingLength;
OutDma[DmaBufPtr][0] = (UBYTE)MsgSize;\
OutDma[DmaBufPtr][1] = (UBYTE)(MsgSize>>8);\
}\
- else\
+ else if (1 == LengthSize)\
{\
OutDma[DmaBufPtr][0] = (UBYTE)MsgSize;\
}\
@@ -212,7 +219,7 @@ static UWORD RemainingLength;
}
-#define BTReceivedData(pByteCnt, pToGo)\
+#define BTReceivedData(pByteCnt, pToGo, noLenBytes)\
{\
UWORD InCnt, Cnt;\
*pByteCnt = 0;\
@@ -222,6 +229,11 @@ static UWORD RemainingLength;
{\
InCnt = SIZE_OF_INBUF;\
}\
+ if (noLenBytes)\
+ {\
+ FullRxLength = InCnt;\
+ RemainingLength = InCnt;\
+ }\
InCnt -= InBufOutCnt; /* Remove already read bytes */\
if (InCnt)\
{\
@@ -244,7 +256,7 @@ static UWORD RemainingLength;
/* Remove Length when in strean mode */\
MsgIn = 0;\
}\
- else\
+ else if (1 == LengthSize)\
{\
FullRxLength = pBuffer[0];\
}\