mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-18 03:52:11 +01:00
Needs work but it's sending data now
This commit is contained in:
parent
88bb73f508
commit
5091b16065
@ -180,7 +180,7 @@ static void overoSyncTask(void *parameters)
|
||||
|
||||
// Process event. This calls transmitData
|
||||
UAVTalkSendObject(uavTalkCon, ev.obj, ev.instId, false, 0);
|
||||
|
||||
|
||||
updateTime = xTaskGetTickCount();
|
||||
if(((portTickType) (updateTime - lastUpdateTime)) > 1000) {
|
||||
// Update stats. This will trigger a local send event too
|
||||
@ -212,11 +212,11 @@ static int32_t packData(uint8_t * data, int32_t length)
|
||||
{
|
||||
portTickType tickTime = xTaskGetTickCount();
|
||||
|
||||
/* if( PIOS_COM_SendBufferNonBlocking(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_SendBufferNonBlocking(pios_com_overo_id, data, length) != 0)
|
||||
goto fail;
|
||||
*/
|
||||
|
||||
overosync->sent_bytes += length + 4;
|
||||
|
||||
return length;
|
||||
|
@ -150,8 +150,9 @@ void PIOS_OVERO_DMA_irq_handler(uint32_t overo_id)
|
||||
DMA_ClearFlag(overo_dev->cfg->dma.tx.channel, overo_dev->cfg->dma.irq.flags);
|
||||
|
||||
overo_dev->writing_buffer = 1 - DMA_GetCurrentMemoryTarget(overo_dev->cfg->dma.tx.channel);
|
||||
overo_dev->writing_offset = 0;
|
||||
|
||||
bool rx_need_yield;
|
||||
/* bool rx_need_yield;
|
||||
// Get data from the Rx buffer and add to the fifo
|
||||
(void) (overo_dev->rx_in_cb)(overo_dev->rx_in_context,
|
||||
&overo_dev->rx_buffer[overo_dev->writing_buffer][0],
|
||||
@ -163,13 +164,21 @@ void PIOS_OVERO_DMA_irq_handler(uint32_t overo_id)
|
||||
|
||||
// Fill the buffer with known value to prevent rereading these bytes
|
||||
memset(&overo_dev->rx_buffer[overo_dev->writing_buffer][0], 0xFF, PACKET_SIZE);
|
||||
|
||||
*/
|
||||
// Fill the buffer with known value to prevent resending any bytes
|
||||
memset(&overo_dev->tx_buffer[overo_dev->writing_buffer][0], 0xFF, PACKET_SIZE);
|
||||
|
||||
// Load any pending bytes from TX fifo
|
||||
PIOS_OVERO_WriteData(overo_dev);
|
||||
|
||||
|
||||
|
||||
/*if (overo_dev->tx_out_cb) {
|
||||
bool tx_need_yield = false;
|
||||
(overo_dev->tx_out_cb)(overo_dev->tx_out_context, &overo_dev->tx_buffer[overo_dev->writing_buffer][0], PACKET_SIZE, NULL, &tx_need_yield);
|
||||
if (tx_need_yield) {
|
||||
vPortYieldFromISR();
|
||||
}
|
||||
}*/
|
||||
overo_dev->packets++;
|
||||
}
|
||||
|
||||
@ -314,7 +323,7 @@ static void PIOS_OVERO_TxStart(uint32_t overo_id, uint16_t tx_bytes_avail)
|
||||
// DMA TX enable (enable IRQ) ?
|
||||
|
||||
// Load any pending bytes from TX fifo
|
||||
PIOS_OVERO_WriteData(overo_dev);
|
||||
//PIOS_OVERO_WriteData(overo_dev);
|
||||
}
|
||||
|
||||
static void PIOS_OVERO_RegisterRxCallback(uint32_t overo_id, pios_com_callback rx_in_cb, uint32_t context)
|
||||
|
@ -789,7 +789,6 @@ void PIOS_Board_Init(void) {
|
||||
if (PIOS_OVERO_Init(&pios_overo_id, &pios_overo_cfg)) {
|
||||
PIOS_DEBUG_Assert(0);
|
||||
}
|
||||
|
||||
const uint32_t PACKET_SIZE = 1024;
|
||||
uint8_t * rx_buffer = (uint8_t *) pvPortMalloc(PACKET_SIZE);
|
||||
uint8_t * tx_buffer = (uint8_t *) pvPortMalloc(PACKET_SIZE);
|
||||
|
Loading…
x
Reference in New Issue
Block a user