aboutsummaryrefslogtreecommitdiff
path: root/AT91SAM7S256/Source/d_bt.r
diff options
context:
space:
mode:
authorNicolas Schodet2011-07-04 01:23:24 +0200
committerNicolas Schodet2011-07-04 01:27:42 +0200
commitc331530002825a86f12151266a9772167a3a49ce (patch)
tree9a4bb16c6a87e30629da039e82cbf026dc361009 /AT91SAM7S256/Source/d_bt.r
parent0cb650f1cf6f446bbb0186300a198b5936f49bb4 (diff)
parentb0472321014e8fcb110f4cecad734bb6a7e27ae0 (diff)
Merge branch 'jch-import' into jch-mergejch-merge
Conflicts: AT91SAM7S256/Source/BtTest.inc AT91SAM7S256/Source/Functions.inl AT91SAM7S256/Source/Ui.txt AT91SAM7S256/Source/c_cmd.c AT91SAM7S256/Source/c_input.c AT91SAM7S256/Source/c_output.c AT91SAM7S256/Source/c_ui.c AT91SAM7S256/Source/c_ui.h AT91SAM7S256/Source/d_loader.h AT91SAM7S256/Source/d_lowspeed.r AT91SAM7S256/Source/d_output.c AT91SAM7S256/Source/d_output.h
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];\
}\