Commit a7a1a38d authored by Damien George's avatar Damien George
Browse files

stmhal: Update CC3000 driver to newer version.

Still not working properly.
parent 50073ed5
...@@ -3,14 +3,6 @@ ...@@ -3,14 +3,6 @@
* cc3000_common.c.c - CC3000 Host Driver Implementation. * cc3000_common.c.c - CC3000 Host Driver Implementation.
* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
* *
* Adapted for use with the Arduino/AVR by KTOWN (Kevin Townsend)
* & Limor Fried for Adafruit Industries
* 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
* products from Adafruit!
*
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:
...@@ -60,7 +52,6 @@ ...@@ -60,7 +52,6 @@
#include "socket.h" #include "socket.h"
#include "wlan.h" #include "wlan.h"
#include "evnt_handler.h" #include "evnt_handler.h"
#include "ccdebug.h"
//***************************************************************************** //*****************************************************************************
// //
...@@ -96,12 +87,12 @@ __error__(char *pcFilename, unsigned long ulLine) ...@@ -96,12 +87,12 @@ __error__(char *pcFilename, unsigned long ulLine)
// //
//***************************************************************************** //*****************************************************************************
uint8_t* UINT32_TO_STREAM_f (uint8_t *p, uint32_t u32) unsigned char* UINT32_TO_STREAM_f (unsigned char *p, unsigned long u32)
{ {
*(p)++ = (uint8_t)(u32); *(p)++ = (unsigned char)(u32);
*(p)++ = (uint8_t)((u32) >> 8); *(p)++ = (unsigned char)((u32) >> 8);
*(p)++ = (uint8_t)((u32) >> 16); *(p)++ = (unsigned char)((u32) >> 16);
*(p)++ = (uint8_t)((u32) >> 24); *(p)++ = (unsigned char)((u32) >> 24);
return p; return p;
} }
...@@ -119,10 +110,10 @@ uint8_t* UINT32_TO_STREAM_f (uint8_t *p, uint32_t u32) ...@@ -119,10 +110,10 @@ uint8_t* UINT32_TO_STREAM_f (uint8_t *p, uint32_t u32)
// //
//***************************************************************************** //*****************************************************************************
uint8_t* UINT16_TO_STREAM_f (uint8_t *p, uint16_t u16) unsigned char* UINT16_TO_STREAM_f (unsigned char *p, unsigned short u16)
{ {
*(p)++ = (uint8_t)(u16); *(p)++ = (unsigned char)(u16);
*(p)++ = (uint8_t)((u16) >> 8); *(p)++ = (unsigned char)((u16) >> 8);
return p; return p;
} }
...@@ -140,20 +131,10 @@ uint8_t* UINT16_TO_STREAM_f (uint8_t *p, uint16_t u16) ...@@ -140,20 +131,10 @@ uint8_t* UINT16_TO_STREAM_f (uint8_t *p, uint16_t u16)
// //
//***************************************************************************** //*****************************************************************************
uint16_t STREAM_TO_UINT16_f(char* cp, uint16_t offset) unsigned short STREAM_TO_UINT16_f(char* p, unsigned short offset)
{ {
uint8_t *p = (uint8_t *)cp; return (unsigned short)((unsigned short)((unsigned short)
/* (*(p + offset + 1)) << 8) + (unsigned short)(*(p + offset)));
DEBUGPRINT_F("Stream2u16: ");
DEBUGPRINT_HEX(cp[offset+1]);
DEBUGPRINT_F(" + ");
DEBUGPRINT_HEX(cp[offset]);
DEBUGPRINT_F("\n\r");
*/
return (uint16_t)((uint16_t)
((uint16_t)(*(p + offset + 1)) << 8) +
(uint16_t)(*(p + offset)));
} }
//***************************************************************************** //*****************************************************************************
...@@ -170,23 +151,12 @@ uint16_t STREAM_TO_UINT16_f(char* cp, uint16_t offset) ...@@ -170,23 +151,12 @@ uint16_t STREAM_TO_UINT16_f(char* cp, uint16_t offset)
// //
//***************************************************************************** //*****************************************************************************
uint32_t STREAM_TO_UINT32_f(char * cp, uint16_t offset) unsigned long STREAM_TO_UINT32_f(char* p, unsigned short offset)
{ {
uint8_t *p = (uint8_t *)cp; return (unsigned long)((unsigned long)((unsigned long)
(*(p + offset + 3)) << 24) + (unsigned long)((unsigned long)
/* (*(p + offset + 2)) << 16) + (unsigned long)((unsigned long)
DEBUGPRINT_F("\tStream2u32: "); (*(p + offset + 1)) << 8) + (unsigned long)(*(p + offset)));
DEBUGPRINT_HEX(cp[offset+3]); DEBUGPRINT_F(" + ");
DEBUGPRINT_HEX(cp[offset+2]); DEBUGPRINT_F(" + ");
DEBUGPRINT_HEX(cp[offset+1]); DEBUGPRINT_F(" + ");
DEBUGPRINT_HEX(cp[offset]);
DEBUGPRINT_F("\n\r");
*/
return (uint32_t)((uint32_t)((uint32_t)
(*(p + offset + 3)) << 24) + (uint32_t)((uint32_t)
(*(p + offset + 2)) << 16) + (uint32_t)((uint32_t)
(*(p + offset + 1)) << 8) + (uint32_t)(*(p + offset)));
} }
......
...@@ -3,14 +3,6 @@ ...@@ -3,14 +3,6 @@
* cc3000_common.h - CC3000 Host Driver Implementation. * cc3000_common.h - CC3000 Host Driver Implementation.
* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
* *
* Adapted for use with the Arduino/AVR by KTOWN (Kevin Townsend)
* & Limor Fried for Adafruit Industries
* 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
* products from Adafruit!
*
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:
...@@ -46,9 +38,6 @@ ...@@ -46,9 +38,6 @@
//****************************************************************************** //******************************************************************************
// Include files // Include files
//****************************************************************************** //******************************************************************************
//#include <stdlib.h>
//#include <errno.h>
//#include <stdint.h>
//***************************************************************************** //*****************************************************************************
// //
...@@ -167,11 +156,7 @@ extern "C" { ...@@ -167,11 +156,7 @@ extern "C" {
//***************************************************************************** //*****************************************************************************
// Compound Types // Compound Types
//***************************************************************************** //*****************************************************************************
#ifdef __AVR__
typedef unsigned long time_t; /* KTown: Updated to be compatible with Arduino Time.h */
#else
typedef long time_t; typedef long time_t;
#endif
typedef unsigned long clock_t; typedef unsigned long clock_t;
typedef long suseconds_t; typedef long suseconds_t;
...@@ -268,7 +253,7 @@ extern void SimpleLinkWaitEvent(unsigned short usOpcode, void *pRetParams); ...@@ -268,7 +253,7 @@ extern void SimpleLinkWaitEvent(unsigned short usOpcode, void *pRetParams);
// //
//***************************************************************************** //*****************************************************************************
extern void SimpleLinkWaitData(uint8_t *pBuf, uint8_t *from, uint8_t *fromlen); extern void SimpleLinkWaitData(unsigned char *pBuf, unsigned char *from, unsigned char *fromlen);
//***************************************************************************** //*****************************************************************************
// //
...@@ -284,7 +269,7 @@ extern void SimpleLinkWaitData(uint8_t *pBuf, uint8_t *from, uint8_t *fromlen); ...@@ -284,7 +269,7 @@ extern void SimpleLinkWaitData(uint8_t *pBuf, uint8_t *from, uint8_t *fromlen);
// //
//***************************************************************************** //*****************************************************************************
extern uint8_t* UINT32_TO_STREAM_f (uint8_t *p, uint32_t u32); extern unsigned char* UINT32_TO_STREAM_f (unsigned char *p, unsigned long u32);
//***************************************************************************** //*****************************************************************************
// //
...@@ -300,7 +285,7 @@ extern uint8_t* UINT32_TO_STREAM_f (uint8_t *p, uint32_t u32); ...@@ -300,7 +285,7 @@ extern uint8_t* UINT32_TO_STREAM_f (uint8_t *p, uint32_t u32);
// //
//***************************************************************************** //*****************************************************************************
extern uint8_t* UINT16_TO_STREAM_f (uint8_t *p, uint16_t u16); extern unsigned char* UINT16_TO_STREAM_f (unsigned char *p, unsigned short u16);
//***************************************************************************** //*****************************************************************************
// //
...@@ -316,7 +301,7 @@ extern uint8_t* UINT16_TO_STREAM_f (uint8_t *p, uint16_t u16); ...@@ -316,7 +301,7 @@ extern uint8_t* UINT16_TO_STREAM_f (uint8_t *p, uint16_t u16);
// //
//***************************************************************************** //*****************************************************************************
extern uint16_t STREAM_TO_UINT16_f(char* p, uint16_t offset); extern unsigned short STREAM_TO_UINT16_f(char* p, unsigned short offset);
//***************************************************************************** //*****************************************************************************
// //
...@@ -332,7 +317,7 @@ extern uint16_t STREAM_TO_UINT16_f(char* p, uint16_t offset); ...@@ -332,7 +317,7 @@ extern uint16_t STREAM_TO_UINT16_f(char* p, uint16_t offset);
// //
//***************************************************************************** //*****************************************************************************
extern uint32_t STREAM_TO_UINT32_f(char* p, uint16_t offset); extern unsigned long STREAM_TO_UINT32_f(char* p, unsigned short offset);
//***************************************************************************** //*****************************************************************************
...@@ -361,14 +346,14 @@ extern void cc3k_int_poll(); ...@@ -361,14 +346,14 @@ extern void cc3k_int_poll();
//This macro is used for copying 32 bit to stream while converting to little endian format. //This macro is used for copying 32 bit to stream while converting to little endian format.
#define UINT32_TO_STREAM(_p, _u32) (UINT32_TO_STREAM_f(_p, _u32)) #define UINT32_TO_STREAM(_p, _u32) (UINT32_TO_STREAM_f(_p, _u32))
//This macro is used for copying a specified value length bits (l) to stream while converting to little endian format. //This macro is used for copying a specified value length bits (l) to stream while converting to little endian format.
#define ARRAY_TO_STREAM(p, a, l) {register short _i; for (_i = 0; _i < l; _i++) *(p)++ = ((uint8_t *) a)[_i];} #define ARRAY_TO_STREAM(p, a, l) {register short _i; for (_i = 0; _i < l; _i++) *(p)++ = ((unsigned char *) a)[_i];}
//This macro is used for copying received stream to 8 bit in little endian format. //This macro is used for copying received stream to 8 bit in little endian format.
#define STREAM_TO_UINT8(_p, _offset, _u8) {_u8 = (uint8_t)(*(_p + _offset));} #define STREAM_TO_UINT8(_p, _offset, _u8) {_u8 = (unsigned char)(*(_p + _offset));}
//This macro is used for copying received stream to 16 bit in little endian format. //This macro is used for copying received stream to 16 bit in little endian format.
#define STREAM_TO_UINT16(_p, _offset, _u16) {_u16 = STREAM_TO_UINT16_f(_p, _offset);} #define STREAM_TO_UINT16(_p, _offset, _u16) {_u16 = STREAM_TO_UINT16_f(_p, _offset);}
//This macro is used for copying received stream to 32 bit in little endian format. //This macro is used for copying received stream to 32 bit in little endian format.
#define STREAM_TO_UINT32(_p, _offset, _u32) {_u32 = STREAM_TO_UINT32_f(_p, _offset);} #define STREAM_TO_UINT32(_p, _offset, _u32) {_u32 = STREAM_TO_UINT32_f(_p, _offset);}
#define STREAM_TO_STREAM(p, a, l) {register short _i; for (_i = 0; _i < l; _i++) *(a)++= ((uint8_t *) p)[_i];} #define STREAM_TO_STREAM(p, a, l) {register short _i; for (_i = 0; _i < l; _i++) *(a)++= ((unsigned char *) p)[_i];}
......
/**************************************************************************/
/*!
@file Adafruit_CC3000.cpp
@author KTOWN (Kevin Townsend for Adafruit Industries)
@license BSD (see license.txt)
This is a library for the Adafruit CC3000 WiFi breakout board
This library works with the Adafruit CC3000 breakout
----> https://www.adafruit.com/products/1469
Check out the links above for our tutorials and wiring diagrams
These chips use SPI to communicate.
Adafruit invests time and resources providing this open source code,
please support Adafruit and open-source hardware by purchasing
products from Adafruit!
@section HISTORY
v1.0 - Initial release
*/
/**************************************************************************/
//#include <Arduino.h>
#ifndef _CC3000_DEBUG
#define _CC3000_DEBUG
#define DEBUG_MODE (0)
#define PRINT_F(__s) DEBUGPRINT(FLASHIFY(__s))
#if (DEBUG_MODE != 0)
#define DEBUGPRINT_F(__s) DEBUGPRINT(FLASHIFY(__s))
#define DEBUGPRINT_DEC(x) printDec(x)
#define DEBUGPRINT_DEC16(x) printDec16(x)
#define DEBUGPRINT_HEX(x) printHex(x)
#define DEBUGPRINT_HEX16(x) printHex16(x)
#else
#define DEBUGPRINT_F(__s) /* do nothing! */
#define DEBUGPRINT_DEC(x)
#define DEBUGPRINT_DEC16(x)
#define DEBUGPRINT_HEX(x)
#define DEBUGPRINT_HEX16(x)
#endif
#if 1 // print debugging info
#define DEBUG_PRINT (1)
#define DEBUG_printf(args...) printf(args)
#else // don't print debugging info
#define DEBUG_printf(args...) (void)0
#endif
int printf(const char *fmt, ...);
#endif
...@@ -51,9 +51,14 @@ ...@@ -51,9 +51,14 @@
#include "netapp.h" #include "netapp.h"
#include "evnt_handler.h" #include "evnt_handler.h"
#include "cc3000_common.h" #include "cc3000_common.h"
#include "ccdebug.h"
#include "pybcc3k.h" #include "pybcc3k.h"
#if 0 // print debugging info
#define DEBUG_printf(args...) printf(args)
#else // don't print debugging info
#define DEBUG_printf(args...) (void)0
#endif
#define READ (3) #define READ (3)
#define WRITE (1) #define WRITE (1)
#define HI(value) (((value) & 0xFF00) >> 8) #define HI(value) (((value) & 0xFF00) >> 8)
...@@ -140,7 +145,7 @@ void SpiInit(void) ...@@ -140,7 +145,7 @@ void SpiInit(void)
/**************************************************************************/ /**************************************************************************/
void SpiClose(void) void SpiClose(void)
{ {
DEBUGPRINT_F("\tCC3000: SpiClose"); DEBUG_printf("\tCC3000: SpiClose");
if (sSpiInformation.pRxPacket) if (sSpiInformation.pRxPacket)
{ {
...@@ -158,7 +163,7 @@ void SpiClose(void) ...@@ -158,7 +163,7 @@ void SpiClose(void)
/**************************************************************************/ /**************************************************************************/
void SpiOpen(gcSpiHandleRx pfRxHandler) void SpiOpen(gcSpiHandleRx pfRxHandler)
{ {
DEBUGPRINT_F("\tCC3000: SpiOpen"); DEBUG_printf("\tCC3000: SpiOpen");
sSpiInformation.ulSpiState = eSPI_STATE_POWERUP; sSpiInformation.ulSpiState = eSPI_STATE_POWERUP;
...@@ -177,7 +182,7 @@ void SpiOpen(gcSpiHandleRx pfRxHandler) ...@@ -177,7 +182,7 @@ void SpiOpen(gcSpiHandleRx pfRxHandler)
/* Enable interrupt on the GPIO pin of WLAN IRQ */ /* Enable interrupt on the GPIO pin of WLAN IRQ */
tSLInformation.WlanInterruptEnable(); tSLInformation.WlanInterruptEnable();
DEBUGPRINT_F("\tCC3000: Finished SpiOpen\n\r"); DEBUG_printf("\tCC3000: Finished SpiOpen\n\r");
} }
/**************************************************************************/ /**************************************************************************/
...@@ -191,7 +196,7 @@ extern uint8_t g_csPin, g_irqPin, g_vbatPin, g_IRQnum, g_SPIspeed; ...@@ -191,7 +196,7 @@ extern uint8_t g_csPin, g_irqPin, g_vbatPin, g_IRQnum, g_SPIspeed;
int init_spi(void) int init_spi(void)
{ {
DEBUGPRINT_F("\tCC3000: init_spi\n\r"); DEBUG_printf("\tCC3000: init_spi\n\r");
/* Set POWER_EN pin to output and disable the CC3000 by default */ /* Set POWER_EN pin to output and disable the CC3000 by default */
pinMode(g_vbatPin, OUTPUT); pinMode(g_vbatPin, OUTPUT);
...@@ -222,7 +227,7 @@ int init_spi(void) ...@@ -222,7 +227,7 @@ int init_spi(void)
/* ToDo: Configure IRQ interrupt! */ /* ToDo: Configure IRQ interrupt! */
DEBUGPRINT_F("\tCC3000: Finished init_spi\n\r"); DEBUG_printf("\tCC3000: Finished init_spi\n\r");
return(ESUCCESS); return(ESUCCESS);
} }
...@@ -235,7 +240,7 @@ int init_spi(void) ...@@ -235,7 +240,7 @@ int init_spi(void)
/**************************************************************************/ /**************************************************************************/
long SpiFirstWrite(unsigned char *ucBuf, unsigned short usLength) long SpiFirstWrite(unsigned char *ucBuf, unsigned short usLength)
{ {
DEBUGPRINT_F("\tCC3000: SpiWriteFirst\n\r"); DEBUG_printf("\tCC3000: SpiWriteFirst\n\r");
/* Workaround for the first transaction */ /* Workaround for the first transaction */
CC3000_ASSERT_CS(); CC3000_ASSERT_CS();
...@@ -267,7 +272,7 @@ long SpiWrite(unsigned char *pUserBuffer, unsigned short usLength) ...@@ -267,7 +272,7 @@ long SpiWrite(unsigned char *pUserBuffer, unsigned short usLength)
{ {
unsigned char ucPad = 0; unsigned char ucPad = 0;
DEBUGPRINT_F("\tCC3000: SpiWrite\n\r"); DEBUG_printf("\tCC3000: SpiWrite\n\r");
/* Figure out the total length of the packet in order to figure out if there is padding or not */ /* Figure out the total length of the packet in order to figure out if there is padding or not */
if(!(usLength & 0x0001)) if(!(usLength & 0x0001))
...@@ -288,7 +293,7 @@ long SpiWrite(unsigned char *pUserBuffer, unsigned short usLength) ...@@ -288,7 +293,7 @@ long SpiWrite(unsigned char *pUserBuffer, unsigned short usLength)
* occurred - and we will be stuck here forever! */ * occurred - and we will be stuck here forever! */
if (wlan_tx_buffer[CC3000_TX_BUFFER_SIZE - 1] != CC3000_BUFFER_MAGIC_NUMBER) if (wlan_tx_buffer[CC3000_TX_BUFFER_SIZE - 1] != CC3000_BUFFER_MAGIC_NUMBER)
{ {
DEBUGPRINT_F("\tCC3000: Error - No magic number found in SpiWrite\n\r"); DEBUG_printf("\tCC3000: Error - No magic number found in SpiWrite\n\r");
while (1); while (1);
} }
...@@ -383,7 +388,7 @@ void SpiReadDataSynchronous(unsigned char *data, unsigned short size) ...@@ -383,7 +388,7 @@ void SpiReadDataSynchronous(unsigned char *data, unsigned short size)
/**************************************************************************/ /**************************************************************************/
void SpiReadHeader(void) void SpiReadHeader(void)
{ {
DEBUGPRINT_F("\tCC3000: SpiReadHeader\n\r"); DEBUG_printf("\tCC3000: SpiReadHeader\n\r");
SpiReadDataSynchronous(sSpiInformation.pRxPacket, HEADERS_SIZE_EVNT); SpiReadDataSynchronous(sSpiInformation.pRxPacket, HEADERS_SIZE_EVNT);
} }
...@@ -398,7 +403,7 @@ long SpiReadDataCont(void) ...@@ -398,7 +403,7 @@ long SpiReadDataCont(void)
long data_to_recv; long data_to_recv;
unsigned char *evnt_buff, type; unsigned char *evnt_buff, type;
DEBUGPRINT_F("\tCC3000: SpiReadDataCont\n\r"); DEBUG_printf("\tCC3000: SpiReadDataCont\n\r");
/* Determine what type of packet we have */ /* Determine what type of packet we have */
evnt_buff = sSpiInformation.pRxPacket; evnt_buff = sSpiInformation.pRxPacket;
...@@ -454,7 +459,7 @@ long SpiReadDataCont(void) ...@@ -454,7 +459,7 @@ long SpiReadDataCont(void)
/**************************************************************************/ /**************************************************************************/
void SpiPauseSpi(void) void SpiPauseSpi(void)
{ {
DEBUGPRINT_F("\tCC3000: SpiPauseSpi\n\r"); DEBUG_printf("\tCC3000: SpiPauseSpi\n\r");
ccspi_int_enabled = 0; ccspi_int_enabled = 0;
pyb_cc3000_pause_spi(); pyb_cc3000_pause_spi();
...@@ -467,7 +472,7 @@ void SpiPauseSpi(void) ...@@ -467,7 +472,7 @@ void SpiPauseSpi(void)
/**************************************************************************/ /**************************************************************************/
void SpiResumeSpi(void) void SpiResumeSpi(void)
{ {
DEBUGPRINT_F("\tCC3000: SpiResumeSpi\n\r"); DEBUG_printf("\tCC3000: SpiResumeSpi\n\r");
ccspi_int_enabled = 1; ccspi_int_enabled = 1;
pyb_cc3000_resume_spi(); pyb_cc3000_resume_spi();
...@@ -480,24 +485,24 @@ void SpiResumeSpi(void) ...@@ -480,24 +485,24 @@ void SpiResumeSpi(void)
/**************************************************************************/ /**************************************************************************/
void SpiTriggerRxProcessing(void) void SpiTriggerRxProcessing(void)
{ {
DEBUGPRINT_F("\tCC3000: SpiTriggerRxProcessing\n\r"); DEBUG_printf("\tCC3000: SpiTriggerRxProcessing\n\r");
/* Trigger Rx processing */ /* Trigger Rx processing */
SpiPauseSpi(); SpiPauseSpi();
CC3000_DEASSERT_CS(); CC3000_DEASSERT_CS();
//DEBUGPRINT_F("Magic?\n\r"); //DEBUG_printf("Magic?\n\r");
/* The magic number that resides at the end of the TX/RX buffer (1 byte after the allocated size) /* The magic number that resides at the end of the TX/RX buffer (1 byte after the allocated size)
* for the purpose of detection of the overrun. If the magic number is overriten - buffer overrun * for the purpose of detection of the overrun. If the magic number is overriten - buffer overrun
* occurred - and we will stuck here forever! */ * occurred - and we will stuck here forever! */
if (sSpiInformation.pRxPacket[CC3000_RX_BUFFER_SIZE - 1] != CC3000_BUFFER_MAGIC_NUMBER) if (sSpiInformation.pRxPacket[CC3000_RX_BUFFER_SIZE - 1] != CC3000_BUFFER_MAGIC_NUMBER)
{ {
/* You've got problems if you're here! */ /* You've got problems if you're here! */
DEBUGPRINT_F("\tCC3000: ERROR - magic number missing!\n\r"); DEBUG_printf("\tCC3000: ERROR - magic number missing!\n\r");
while (1); while (1);
} }
//DEBUGPRINT_F("OK!\n\r"); //DEBUG_printf("OK!\n\r");
sSpiInformation.ulSpiState = eSPI_STATE_IDLE; sSpiInformation.ulSpiState = eSPI_STATE_IDLE;
sSpiInformation.SPIRxHandler(sSpiInformation.pRxPacket + SPI_HEADER_SIZE); sSpiInformation.SPIRxHandler(sSpiInformation.pRxPacket + SPI_HEADER_SIZE);
} }
...@@ -509,14 +514,14 @@ void SpiTriggerRxProcessing(void) ...@@ -509,14 +514,14 @@ void SpiTriggerRxProcessing(void)
/**************************************************************************/ /**************************************************************************/
void SSIContReadOperation(void) void SSIContReadOperation(void)
{ {
DEBUGPRINT_F("\tCC3000: SpiContReadOperation\n\r"); DEBUG_printf("\tCC3000: SpiContReadOperation\n\r");
/* The header was read - continue with the payload read */ /* The header was read - continue with the payload read */
if (!SpiReadDataCont()) if (!SpiReadDataCont())
{ {
/* All the data was read - finalize handling by switching to teh task /* All the data was read - finalize handling by switching to teh task
* and calling from task Event Handler */ * and calling from task Event Handler */
//DEBUGPRINT_F("SPItrig\n\r"); //DEBUG_printf("SPItrig\n\r");
SpiTriggerRxProcessing(); SpiTriggerRxProcessing();
} }
} }
...@@ -528,23 +533,6 @@ void SSIContReadOperation(void) ...@@ -528,23 +533,6 @@ void SSIContReadOperation(void)
/**************************************************************************/ /**************************************************************************/
void WriteWlanPin( unsigned char val ) void WriteWlanPin( unsigned char val )
{ {
#if 0
if (DEBUG_MODE)
{
DEBUGPRINT_F("\tCC3000: WriteWlanPin - ");
DEBUGPRINT_DEC(val);
DEBUGPRINT_F("\n\r");
delay(1);
}
if (val)
{
digitalWrite(g_vbatPin, HIGH);
}
else
{
digitalWrite(g_vbatPin, LOW);
}
#endif
pyb_cc3000_set_en(val == WLAN_ENABLE); pyb_cc3000_set_en(val == WLAN_ENABLE);
} }
...@@ -555,9 +543,7 @@ void WriteWlanPin( unsigned char val ) ...@@ -555,9 +543,7 @@ void WriteWlanPin( unsigned char val )
/**************************************************************************/ /**************************************************************************/
long ReadWlanInterruptPin(void) long ReadWlanInterruptPin(void)
{ {
DEBUGPRINT_F("\tCC3000: ReadWlanInterruptPin - "); DEBUG_printf("CC3000: ReadWlanInterruptPin\n");
DEBUGPRINT_DEC(digitalRead(g_irqPin));
DEBUGPRINT_F("\n\r");
return pyb_cc3000_get_irq(); return pyb_cc3000_get_irq();
} }
...@@ -569,9 +555,9 @@ long ReadWlanInterruptPin(void) ...@@ -569,9 +555,9 @@ long ReadWlanInterruptPin(void)
/**************************************************************************/