summaryrefslogtreecommitdiffstatshomepage
path: root/stmhal/cc3k/hci.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-05-10 21:28:40 +0100
committerDamien George <damien.p.george@gmail.com>2014-05-10 21:28:40 +0100
commit50073ed5d61a89af95f1497c24965e50e95e6e9d (patch)
tree5cf8a2b051c25cc2dfcf87f1e8dd2a2c0b3abc8b /stmhal/cc3k/hci.c
parent94d8246272b2df7dbfb70ec85ed06e3b13793bac (diff)
downloadmicropython-50073ed5d61a89af95f1497c24965e50e95e6e9d.tar.gz
micropython-50073ed5d61a89af95f1497c24965e50e95e6e9d.zip
stmhal/cc3k: Remove spaces and tabs at end of lines.
Diffstat (limited to 'stmhal/cc3k/hci.c')
-rw-r--r--stmhal/cc3k/hci.c74
1 files changed, 37 insertions, 37 deletions
diff --git a/stmhal/cc3k/hci.c b/stmhal/cc3k/hci.c
index 533311f175..f111166074 100644
--- a/stmhal/cc3k/hci.c
+++ b/stmhal/cc3k/hci.c
@@ -3,9 +3,9 @@
* hci.c - CC3000 Host Driver Implementation.
* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
*
-* Adapted for use with the Arduino/AVR by KTOWN (Kevin Townsend)
+* Adapted for use with the Arduino/AVR by KTOWN (Kevin Townsend)
* & Limor Fried for Adafruit Industries
-* This library works with the Adafruit CC3000 breakout
+* This library works with the Adafruit CC3000 breakout
* ----> https://www.adafruit.com/products/1469
* Adafruit invests time and resources providing this open source code,
* please support Adafruit and open-source hardware by purchasing
@@ -20,23 +20,23 @@
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
-* documentation and/or other materials provided with the
+* documentation and/or other materials provided with the
* distribution.
*
* Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*****************************************************************************/
@@ -76,21 +76,21 @@
//! @brief Initiate an HCI command.
//
//*****************************************************************************
-unsigned short
+unsigned short
hci_command_send(unsigned short usOpcode, unsigned char *pucBuff,
unsigned char ucArgsLength)
-{
+{
unsigned char *stream;
-
+
stream = (pucBuff + SPI_HEADER_SIZE);
-
+
UINT8_TO_STREAM(stream, HCI_TYPE_CMND);
stream = UINT16_TO_STREAM(stream, usOpcode);
UINT8_TO_STREAM(stream, ucArgsLength);
-
+
//Update the opcode of the event we will be waiting for
SpiWrite(pucBuff, ucArgsLength + SIMPLE_LINK_HCI_CMND_HEADER_SIZE);
-
+
return(0);
}
@@ -110,25 +110,25 @@ hci_command_send(unsigned short usOpcode, unsigned char *pucBuff,
//
//*****************************************************************************
long
-hci_data_send(unsigned char ucOpcode,
+hci_data_send(unsigned char ucOpcode,
unsigned char *ucArgs,
- unsigned short usArgsLength,
+ unsigned short usArgsLength,
unsigned short usDataLength,
const unsigned char *ucTail,
unsigned short usTailLength)
{
unsigned char *stream;
-
+
stream = ((ucArgs) + SPI_HEADER_SIZE);
-
+
UINT8_TO_STREAM(stream, HCI_TYPE_DATA);
UINT8_TO_STREAM(stream, ucOpcode);
UINT8_TO_STREAM(stream, usArgsLength);
stream = UINT16_TO_STREAM(stream, usArgsLength + usDataLength + usTailLength);
-
+
// Send the packet over the SPI
SpiWrite(ucArgs, SIMPLE_LINK_HCI_DATA_HEADER_SIZE + usArgsLength + usDataLength + usTailLength);
-
+
return(ESUCCESS);
}
@@ -149,17 +149,17 @@ hci_data_send(unsigned char ucOpcode,
//*****************************************************************************
void hci_data_command_send(unsigned short usOpcode, unsigned char *pucBuff,
unsigned char ucArgsLength,unsigned short ucDataLength)
-{
+{
unsigned char *stream = (pucBuff + SPI_HEADER_SIZE);
-
+
UINT8_TO_STREAM(stream, HCI_TYPE_DATA);
UINT8_TO_STREAM(stream, usOpcode);
UINT8_TO_STREAM(stream, ucArgsLength);
stream = UINT16_TO_STREAM(stream, ucArgsLength + ucDataLength);
-
+
// Send the command over SPI on data channel
SpiWrite(pucBuff, ucArgsLength + ucDataLength + SIMPLE_LINK_HCI_DATA_CMND_HEADER_SIZE);
-
+
return;
}
@@ -169,7 +169,7 @@ void hci_data_command_send(unsigned short usOpcode, unsigned char *pucBuff,
//!
//! @param usOpcode command operation code
//! @param pucBuff pointer to the command's arguments buffer
-//! @param patch pointer to patch content buffer
+//! @param patch pointer to patch content buffer
//! @param usDataLength data length
//!
//! @return none
@@ -179,37 +179,37 @@ void hci_data_command_send(unsigned short usOpcode, unsigned char *pucBuff,
//*****************************************************************************
void
hci_patch_send(unsigned char ucOpcode, unsigned char *pucBuff, char *patch, unsigned short usDataLength)
-{
+{
unsigned char *data_ptr = (pucBuff + SPI_HEADER_SIZE);
unsigned short usTransLength;
unsigned char *stream = (pucBuff + SPI_HEADER_SIZE);
-
+
UINT8_TO_STREAM(stream, HCI_TYPE_PATCH);
UINT8_TO_STREAM(stream, ucOpcode);
stream = UINT16_TO_STREAM(stream, usDataLength + SIMPLE_LINK_HCI_PATCH_HEADER_SIZE);
-
+
if (usDataLength <= SL_PATCH_PORTION_SIZE)
{
UINT16_TO_STREAM(stream, usDataLength);
stream = UINT16_TO_STREAM(stream, usDataLength);
memcpy((pucBuff + SPI_HEADER_SIZE) + HCI_PATCH_HEADER_SIZE, patch, usDataLength);
-
+
// Update the opcode of the event we will be waiting for
SpiWrite(pucBuff, usDataLength + HCI_PATCH_HEADER_SIZE);
}
else
{
-
+
usTransLength = (usDataLength/SL_PATCH_PORTION_SIZE);
UINT16_TO_STREAM(stream, usDataLength + SIMPLE_LINK_HCI_PATCH_HEADER_SIZE + usTransLength*SIMPLE_LINK_HCI_PATCH_HEADER_SIZE);
stream = UINT16_TO_STREAM(stream, SL_PATCH_PORTION_SIZE);
memcpy(pucBuff + SPI_HEADER_SIZE + HCI_PATCH_HEADER_SIZE, patch, SL_PATCH_PORTION_SIZE);
usDataLength -= SL_PATCH_PORTION_SIZE;
patch += SL_PATCH_PORTION_SIZE;
-
+
// Update the opcode of the event we will be waiting for
SpiWrite(pucBuff, SL_PATCH_PORTION_SIZE + HCI_PATCH_HEADER_SIZE);
-
+
while (usDataLength)
{
cc3k_int_poll();
@@ -218,18 +218,18 @@ hci_patch_send(unsigned char ucOpcode, unsigned char *pucBuff, char *patch, unsi
{
usTransLength = usDataLength;
usDataLength = 0;
-
+
}
else
{
usTransLength = SL_PATCH_PORTION_SIZE;
usDataLength -= usTransLength;
}
-
+
*(unsigned short *)data_ptr = usTransLength;
memcpy(data_ptr + SIMPLE_LINK_HCI_PATCH_HEADER_SIZE, patch, usTransLength);
patch += usTransLength;
-
+
// Update the opcode of the event we will be waiting for
SpiWrite((unsigned char *)data_ptr, usTransLength + sizeof(usTransLength));
}