mirror of
https://github.com/apache/nuttx.git
synced 2026-06-02 01:21:26 +08:00
Nucleo F401RE: Remove PX4 cruft that can in with the port
This commit is contained in:
@@ -610,18 +610,10 @@ static void * select_thread_func(FAR void *arg)
|
||||
|
||||
static void * cc3000_worker(FAR void *arg)
|
||||
{
|
||||
FAR struct cc3000_dev_s *priv = (FAR struct cc3000_dev_s *)arg;
|
||||
FAR struct cc3000_config_s *config;
|
||||
int ret;
|
||||
FAR struct cc3000_dev_s *priv = (FAR struct cc3000_dev_s *)arg;
|
||||
int ret;
|
||||
|
||||
ASSERT(priv != NULL);
|
||||
|
||||
/* Get a pointer the callbacks for convenience (and so the code is not so
|
||||
* ugly).
|
||||
*/
|
||||
|
||||
config = priv->config;
|
||||
DEBUGASSERT(config != NULL);
|
||||
ASSERT(priv != NULL && priv->config != NULL);
|
||||
|
||||
/* We have started release our creator*/
|
||||
|
||||
@@ -705,7 +697,8 @@ static void * cc3000_worker(FAR void *arg)
|
||||
priv->rx_buffer.len = data_to_recv;
|
||||
|
||||
ret = mq_send(priv->queue, &priv->rx_buffer, sizeof(priv->rx_buffer), 1);
|
||||
DEBUGASSERT(ret>=0);
|
||||
DEBUGASSERT(ret >= 0);
|
||||
UNUSED(ret);
|
||||
|
||||
/* Notify any waiters that new CC3000 data is available */
|
||||
|
||||
@@ -714,9 +707,11 @@ static void * cc3000_worker(FAR void *arg)
|
||||
/* Give up driver */
|
||||
|
||||
cc3000_devgive(priv);
|
||||
|
||||
nllvdbg("Wait On Completion\n");
|
||||
sem_wait(priv->wrkwaitsem);
|
||||
nllvdbg("Completed S:%d irq :%d\n",priv->state,priv->config->irq_read(priv->config));
|
||||
nllvdbg("Completed S:%d irq :%d\n",
|
||||
priv->state, priv->config->irq_read(priv->config));
|
||||
|
||||
sem_getvalue(&priv->irqsem, &count);
|
||||
if (priv->config->irq_read(priv->config) && count==0)
|
||||
@@ -731,17 +726,17 @@ static void * cc3000_worker(FAR void *arg)
|
||||
|
||||
continue;
|
||||
}
|
||||
} /* eSPI_STATE_WRITE_DONE or eSPI_STATE_IDLE */
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
nllvdbg("default: State%d\n",priv->state);
|
||||
break;
|
||||
} /* end switch */
|
||||
} /* end if */
|
||||
}
|
||||
}
|
||||
|
||||
cc3000_devgive(priv);
|
||||
} /* while (1) */
|
||||
}
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -92,7 +92,9 @@
|
||||
|
||||
#ifdef CONFIG_CC3000_MT
|
||||
/* lock to serialze access to driver (spi protocol is window size 1) */
|
||||
|
||||
extern pthread_mutex_t g_cc3000_mut;
|
||||
|
||||
/* This structure describes the state of one CC3000 driver instance */
|
||||
|
||||
typedef struct cc3000_socket_ent
|
||||
@@ -185,6 +187,7 @@ static inline void cc3000_lib_lock(void)
|
||||
#ifdef CONFIG_CC3000_MT
|
||||
int status = pthread_mutex_lock(&g_cc3000_mut);
|
||||
DEBUGASSERT(status == 0);
|
||||
UNUSED(status);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -193,6 +196,7 @@ static inline void cc3000_lib_unlock(void)
|
||||
#ifdef CONFIG_CC3000_MT
|
||||
int status = pthread_mutex_unlock(&g_cc3000_mut);
|
||||
DEBUGASSERT(status == 0);
|
||||
UNUSED(status);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -264,6 +264,7 @@ void cc3000_open(gcSpiHandleRx pfRxHandler)
|
||||
status = pthread_create(&spiconf.unsoliced_thread, &attr,
|
||||
unsoliced_thread_func, NULL);
|
||||
DEBUGASSERT(status == 0)
|
||||
UNUSED(status);
|
||||
}
|
||||
|
||||
DEBUGASSERT(spiconf.cc3000fd);
|
||||
|
||||
@@ -895,7 +895,7 @@ void update_socket_active_status(char *resp_params)
|
||||
* opcode in a global variable.
|
||||
*
|
||||
* Input Parameters:
|
||||
* usOpcode command operation code
|
||||
* opcode command operation code
|
||||
* pRetParams command return parameters
|
||||
*
|
||||
* Returned Value:
|
||||
@@ -903,14 +903,14 @@ void update_socket_active_status(char *resp_params)
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
void SimpleLinkWaitEvent(uint16_t usOpcode, void *pRetParams)
|
||||
void SimpleLinkWaitEvent(uint16_t opcode, void *pRetParams)
|
||||
{
|
||||
/* In the blocking implementation the control to caller will be returned only
|
||||
* after the end of current transaction
|
||||
*/
|
||||
|
||||
tSLInformation.usRxEventOpcode = usOpcode;
|
||||
nllvdbg("Looking for usOpcode 0x%x\n",usOpcode);
|
||||
tSLInformation.usRxEventOpcode = opcode;
|
||||
nllvdbg("Looking for opcode 0x%x\n",opcode);
|
||||
uint16_t event_type;
|
||||
|
||||
do
|
||||
@@ -925,22 +925,22 @@ void SimpleLinkWaitEvent(uint16_t usOpcode, void *pRetParams)
|
||||
nllvdbg("Evtn:0x%x\n",event_type);
|
||||
}
|
||||
|
||||
if (event_type != usOpcode)
|
||||
if (event_type != opcode)
|
||||
{
|
||||
if (hci_unsolicited_event_handler() == 1)
|
||||
{
|
||||
nllvdbg("Processed Event 0x%x want 0x%x\n",event_type, usOpcode);
|
||||
nllvdbg("Processed Event 0x%x want 0x%x\n",event_type, opcode);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
nllvdbg("Processing usOpcode 0x%x\n",usOpcode);
|
||||
nllvdbg("Processing opcode 0x%x\n",opcode);
|
||||
hci_event_handler(pRetParams, 0, 0);
|
||||
}
|
||||
}
|
||||
while (tSLInformation.usRxEventOpcode != 0);
|
||||
|
||||
nllvdbg("Done for usOpcode 0x%x\n",usOpcode);
|
||||
nllvdbg("Done for opcode 0x%x\n",opcode);
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
@@ -968,7 +968,7 @@ void SimpleLinkWaitData(uint8_t *pBuf, uint8_t *from, uint8_t *fromlen)
|
||||
|
||||
nllvdbg("Looking for Data\n");
|
||||
uint16_t event_type;
|
||||
uint16_t usOpcode = tSLInformation.usRxEventOpcode;
|
||||
uint16_t opcode = tSLInformation.usRxEventOpcode;
|
||||
|
||||
do
|
||||
{
|
||||
@@ -983,20 +983,23 @@ void SimpleLinkWaitData(uint8_t *pBuf, uint8_t *from, uint8_t *fromlen)
|
||||
}
|
||||
else
|
||||
{
|
||||
STREAM_TO_UINT16((char *)tSLInformation.pucReceivedData, HCI_EVENT_OPCODE_OFFSET,event_type);
|
||||
nllvdbg("Evtn:0x%x\n",event_type);
|
||||
STREAM_TO_UINT16((char *)tSLInformation.pucReceivedData, HCI_EVENT_OPCODE_OFFSET, event_type);
|
||||
nllvdbg("Evtn:0x%x\n", event_type);
|
||||
|
||||
if (hci_unsolicited_event_handler() == 1)
|
||||
{
|
||||
nllvdbg("Processed Event 0x%x want Data! Opcode 0x%x\n",event_type, usOpcode);
|
||||
nllvdbg("Processed Event 0x%x want Data! Opcode 0x%x\n", event_type, opcode);
|
||||
}
|
||||
else
|
||||
{
|
||||
nllvdbg("!!!!!usOpcode 0x%x\n",usOpcode);
|
||||
nllvdbg("!!!!!opcode 0x%x\n",opcode);
|
||||
}
|
||||
|
||||
UNUSED(event_type);
|
||||
}
|
||||
}
|
||||
while (*tSLInformation.pucReceivedData == HCI_TYPE_EVNT);
|
||||
|
||||
nllvdbg("Done for Data 0x%x\n",usOpcode);
|
||||
nllvdbg("Done for Data 0x%x\n", opcode);
|
||||
UNUSED(opcode);
|
||||
}
|
||||
|
||||
@@ -236,12 +236,16 @@ void wlan_init(size_t max_tx_len,
|
||||
|
||||
void SpiReceiveHandler(void *pvBuffer)
|
||||
{
|
||||
uint16_t event_type;
|
||||
|
||||
tSLInformation.pucReceivedData = (uint8_t *)pvBuffer;
|
||||
tSLInformation.usEventOrDataReceived = 1;
|
||||
|
||||
uint16_t event_type;
|
||||
STREAM_TO_UINT16((char *)tSLInformation.pucReceivedData, HCI_EVENT_OPCODE_OFFSET,event_type);
|
||||
nllvdbg("Evtn:0x%x\n", event_type);
|
||||
STREAM_TO_UINT16((char *)tSLInformation.pucReceivedData,
|
||||
HCI_EVENT_OPCODE_OFFSET, event_type);
|
||||
|
||||
nllvdbg("Evnt:0x%x\n", event_type);
|
||||
UNUSED(event_type);
|
||||
|
||||
hci_unsolicited_event_handler();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user