mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-18 03:52:11 +01:00
Zero out the packet counter when pios_over is initialized.
This commit is contained in:
parent
fb215fd095
commit
6a3c067c18
@ -212,11 +212,11 @@ static int32_t packData(uint8_t * data, int32_t length)
|
||||
{
|
||||
portTickType tickTime = xTaskGetTickCount();
|
||||
|
||||
if( PIOS_COM_SendBuffer(pios_com_overo_id, (uint8_t *) &tickTime, sizeof(tickTime)) != 0)
|
||||
/* if( PIOS_COM_SendBufferNonBlocking(pios_com_overo_id, (uint8_t *) &tickTime, sizeof(tickTime)) != 0)
|
||||
goto fail;
|
||||
if( PIOS_COM_SendBuffer(pios_com_overo_id, data, length) != 0)
|
||||
if( PIOS_COM_SendBufferNonBlocking(pios_com_overo_id, data, length) != 0)
|
||||
goto fail;
|
||||
|
||||
*/
|
||||
overosync->sent_bytes += length + 4;
|
||||
|
||||
return length;
|
||||
|
@ -106,6 +106,7 @@ static struct pios_overo_dev * PIOS_OVERO_alloc(void)
|
||||
overo_dev->rx_in_context = 0;
|
||||
overo_dev->tx_out_cb = 0;
|
||||
overo_dev->tx_out_context = 0;
|
||||
overo_dev->packets = 0;
|
||||
overo_dev->magic = PIOS_OVERO_DEV_MAGIC;
|
||||
return(overo_dev);
|
||||
}
|
||||
@ -263,12 +264,7 @@ int32_t PIOS_OVERO_Init(uint32_t * overo_id, const struct pios_overo_cfg * cfg)
|
||||
SPI_DeInit(overo_dev->cfg->regs);
|
||||
SPI_Init(overo_dev->cfg->regs, (SPI_InitTypeDef*)&(overo_dev->cfg->init));
|
||||
|
||||
/* Configure CRC calculation */
|
||||
if (overo_dev->cfg->use_crc) {
|
||||
SPI_CalculateCRC(overo_dev->cfg->regs, ENABLE);
|
||||
} else {
|
||||
SPI_CalculateCRC(overo_dev->cfg->regs, DISABLE);
|
||||
}
|
||||
|
||||
/* Enable SPI */
|
||||
SPI_Cmd(overo_dev->cfg->regs, ENABLE);
|
||||
|
@ -455,6 +455,7 @@ void PIOS_SPI_flash_irq_handler(void)
|
||||
*/
|
||||
#include <pios_overo_priv.h>
|
||||
void PIOS_OVERO_irq_handler(void);
|
||||
void DMA1_Streamr0_IRQHandler(void) __attribute__((alias("PIOS_OVERO_irq_handler")));
|
||||
void DMA1_Streamr7_IRQHandler(void) __attribute__((alias("PIOS_OVERO_irq_handler")));
|
||||
static const struct pios_overo_cfg pios_overo_cfg = {
|
||||
.regs = SPI3,
|
||||
@ -474,7 +475,7 @@ static const struct pios_overo_cfg pios_overo_cfg = {
|
||||
.dma = {
|
||||
.irq = {
|
||||
// Note this is the stream ID that triggers interrupts (in this case TX)
|
||||
.flags = (DMA_IT_TCIF7 | DMA_IT_TEIF7), //DMA_IT_HTIF7),
|
||||
.flags = (DMA_IT_TCIF0 | DMA_IT_TEIF0 | DMA_IT_TCIF7 | DMA_IT_TEIF7), //DMA_IT_HTIF7),
|
||||
.init = {
|
||||
.NVIC_IRQChannel = DMA1_Stream7_IRQn,
|
||||
.NVIC_IRQChannelPreemptionPriority = PIOS_IRQ_PRIO_HIGH,
|
||||
|
Loading…
x
Reference in New Issue
Block a user