mirror of
https://github.com/apache/nuttx.git
synced 2026-06-02 01:21:26 +08:00
CC3000 driver updates from David Sidrane
This commit is contained in:
@@ -54,4 +54,22 @@ config CC3000_SPI_FREQUENCY
|
||||
---help---
|
||||
Define to use a different SPI bus frequency.
|
||||
|
||||
config CC3000_WORKER_STACKSIZE
|
||||
int "Worker thread stack size"
|
||||
default 240
|
||||
|
||||
config CC3000_SELECT_STACKSIZE
|
||||
int "Select thread stack size"
|
||||
default 368
|
||||
|
||||
config CC3000_UNSOLICED_STACKSIZE
|
||||
int "Unsolicited thread stack size"
|
||||
default 264
|
||||
|
||||
config CC3000_PROBES
|
||||
bool "Thread probes"
|
||||
default n
|
||||
---help---
|
||||
Select to use DO and D1 to indicate worker thread and ISR
|
||||
|
||||
endif
|
||||
|
||||
@@ -85,13 +85,27 @@
|
||||
#error "CONFIG_MQ_MAXMSGSIZE needs to be >= CC3000_RX_BUFFER_SIZE"
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_CC3000_WORKER_STACKSIZE
|
||||
# define CONFIG_CC3000_WORKER_STACKSIZE 240
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_CC3000_SELECT_STACKSIZE
|
||||
# define CONFIG_CC3000_SELECT_STACKSIZE 368
|
||||
#endif
|
||||
|
||||
#ifndef ARRAY_SIZE
|
||||
# define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
|
||||
#endif
|
||||
#define NUMBER_OF_MSGS 2
|
||||
#define NUMBER_OF_MSGS 1
|
||||
|
||||
#define FREE_SLOT -1
|
||||
|
||||
#if defined(CONFIG_CC3000_PROBES)
|
||||
#define PROBE(pin,state) priv->config->probe(priv->config,pin, state)
|
||||
#else
|
||||
#define PROBE(pin,state)
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
@@ -560,14 +574,14 @@ static void * cc3000_worker(FAR void *arg)
|
||||
sem_post(&priv->readysem);
|
||||
while(1)
|
||||
{
|
||||
priv->config->probe(config,0, 1);
|
||||
PROBE(0,1);
|
||||
cc3000_devtake(priv);
|
||||
|
||||
/* Done ? */
|
||||
|
||||
if ((cc3000_wait_irq(priv) != -EINTR) && (priv->workertid != -1))
|
||||
{
|
||||
priv->config->probe(config,0, 0);
|
||||
PROBE(0,0);
|
||||
nllvdbg("State%d\n",priv->state);
|
||||
switch (priv->state)
|
||||
{
|
||||
@@ -694,9 +708,9 @@ static int cc3000_interrupt(int irq, FAR void *context)
|
||||
|
||||
/* Run the worker thread */
|
||||
|
||||
priv->config->probe(priv->config,1, 0);
|
||||
PROBE(1,0);
|
||||
sem_post(&priv->irqsem);
|
||||
priv->config->probe(priv->config,1, 1);
|
||||
PROBE(1,1);
|
||||
|
||||
/* Clear any pending interrupts and return success */
|
||||
|
||||
@@ -781,7 +795,7 @@ static int cc3000_open(FAR struct file *filep)
|
||||
}
|
||||
|
||||
pthread_attr_init(&tattr);
|
||||
tattr.stacksize = 336;
|
||||
tattr.stacksize = CONFIG_CC3000_WORKER_STACKSIZE;
|
||||
param.sched_priority = SCHED_PRIORITY_MAX;
|
||||
pthread_attr_setschedparam(&tattr, ¶m);
|
||||
|
||||
@@ -796,7 +810,7 @@ static int cc3000_open(FAR struct file *filep)
|
||||
}
|
||||
|
||||
pthread_attr_init(&tattr);
|
||||
tattr.stacksize = 460;
|
||||
tattr.stacksize = CONFIG_CC3000_SELECT_STACKSIZE;
|
||||
param.sched_priority = SCHED_PRIORITY_DEFAULT+10;
|
||||
pthread_attr_setschedparam(&tattr, ¶m);
|
||||
ret = pthread_create(&priv->selecttid, &tattr, select_thread_func,
|
||||
|
||||
@@ -43,6 +43,10 @@
|
||||
* Pre-processor Definitions
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef CONFIG_CC3000_UNSOLICED_STACKSIZE
|
||||
# define CONFIG_CC3000_UNSOLICED_STACKSIZE 264
|
||||
#endif
|
||||
|
||||
#undef SPI_DEBUG /* Define to enable debug */
|
||||
#undef SPI_VERBOSE /* Define to enable verbose debug */
|
||||
|
||||
@@ -240,7 +244,7 @@ void SpiOpen(gcSpiHandleRx pfRxHandler)
|
||||
pthread_attr_t attr;
|
||||
struct sched_param param;
|
||||
pthread_attr_init(&attr);
|
||||
attr.stacksize = 292;
|
||||
attr.stacksize = CONFIG_CC3000_UNSOLICED_STACKSIZE;
|
||||
param.sched_priority = SCHED_PRIORITY_DEFAULT-10;
|
||||
pthread_attr_setschedparam(&attr, ¶m);
|
||||
status = pthread_create(&spiconf.unsoliced_thread, &attr,
|
||||
|
||||
@@ -176,14 +176,6 @@ static void SimpleLink_Init_Start(uint16_t usPatchesAvailableAtHost)
|
||||
* sFWPatches 0 no patch or pointer to FW patches
|
||||
* sDriverPatches 0 no patch or pointer to driver patches
|
||||
* sBootLoaderPatches 0 no patch or pointer to bootloader patches
|
||||
* sReadWlanInterruptPin init callback. the callback read wlan
|
||||
* interrupt status.
|
||||
* sWlanInterruptEnable init callback. the callback enable wlan
|
||||
* interrupt.
|
||||
* sWlanInterruptDisable init callback. the callback disable wlan
|
||||
* interrupt.
|
||||
* sWriteWlanPin init callback. the callback write value
|
||||
* to device pin.
|
||||
*
|
||||
* Returned Value:
|
||||
* None
|
||||
|
||||
Reference in New Issue
Block a user