From 6c5075bc99ba07f46562f7f10db14e153d7a93ec Mon Sep 17 00:00:00 2001 From: jhansen Date: Mon, 26 Apr 2010 21:49:44 +0000 Subject: git-svn-id: https://mindboards.svn.sourceforge.net/svnroot/mindboards/lms_nbcnxc_128/trunk@6 c9361245-7fe8-9947-84e8-057757c4e366 --- AT91SAM7S256/Source/d_bt.r | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'AT91SAM7S256/Source/d_bt.r') diff --git a/AT91SAM7S256/Source/d_bt.r b/AT91SAM7S256/Source/d_bt.r index 8c9558f..0e9944e 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;\ }\ @@ -244,7 +251,7 @@ static UWORD RemainingLength; /* Remove Length when in strean mode */\ MsgIn = 0;\ }\ - else\ + else if (1 == LengthSize)\ {\ FullRxLength = pBuffer[0];\ }\ -- cgit v1.2.3 From c41dd0a02d4d92af0ba337fa530c58be6cceb5b4 Mon Sep 17 00:00:00 2001 From: tcsadmin Date: Wed, 13 Oct 2010 16:53:26 +0000 Subject: Changes to support raw/gps bluetooth data mode git-svn-id: https://mindboards.svn.sourceforge.net/svnroot/mindboards/lms_nbcnxc_128/trunk@19 c9361245-7fe8-9947-84e8-057757c4e366 --- AT91SAM7S256/Source/d_bt.c | 4 ++-- AT91SAM7S256/Source/d_bt.h | 2 +- AT91SAM7S256/Source/d_bt.r | 7 ++++++- 3 files changed, 9 insertions(+), 4 deletions(-) (limited to 'AT91SAM7S256/Source/d_bt.r') diff --git a/AT91SAM7S256/Source/d_bt.c b/AT91SAM7S256/Source/d_bt.c index 1a76fa5..cac6e76 100644 --- a/AT91SAM7S256/Source/d_bt.c +++ b/AT91SAM7S256/Source/d_bt.c @@ -124,12 +124,12 @@ void dBtSend(UBYTE *OutputBuffer, UBYTE BytesToSend) BTSend(OutputBuffer, BytesToSend); } -UWORD dBtReceivedData(UWORD *pLength, UWORD *pBytesToGo) +UWORD dBtReceivedData(UWORD *pLength, UWORD *pBytesToGo, UBYTE NoLengthBytes) { UWORD RtnVal; RtnVal = TRUE; - BTReceivedData(pLength, pBytesToGo); + BTReceivedData(pLength, pBytesToGo, NoLengthBytes); if (*pLength) { SETTimeout(0); diff --git a/AT91SAM7S256/Source/d_bt.h b/AT91SAM7S256/Source/d_bt.h index aab544f..5a5fd97 100644 --- a/AT91SAM7S256/Source/d_bt.h +++ b/AT91SAM7S256/Source/d_bt.h @@ -33,7 +33,7 @@ void dBtResetTimeOut(void); void dBtClearTimeOut(void); UBYTE dBtGetBc4CmdSignal(void); UWORD dBtTxEnd(void); -UWORD dBtReceivedData(UWORD *pLength, UWORD *pBytesToGo); +UWORD dBtReceivedData(UWORD *pLength, UWORD *pBytesToGo, UBYTE NoLengthBytes); UWORD dBtCheckForTxBuf(void); #endif diff --git a/AT91SAM7S256/Source/d_bt.r b/AT91SAM7S256/Source/d_bt.r index 0e9944e..76c079b 100644 --- a/AT91SAM7S256/Source/d_bt.r +++ b/AT91SAM7S256/Source/d_bt.r @@ -219,7 +219,7 @@ static UWORD RemainingLength; } -#define BTReceivedData(pByteCnt, pToGo)\ +#define BTReceivedData(pByteCnt, pToGo, noLenBytes)\ {\ UWORD InCnt, Cnt;\ *pByteCnt = 0;\ @@ -229,6 +229,11 @@ static UWORD RemainingLength; {\ InCnt = SIZE_OF_INBUF;\ }\ + if (noLenBytes)\ + {\ + FullRxLength = InCnt;\ + RemainingLength = InCnt;\ + }\ InCnt -= InBufOutCnt; /* Remove already read bytes */\ if (InCnt)\ {\ -- cgit v1.2.3