Added flag to packetusart (c) PostPacket to omit wait for crc scheduling
This commit is contained in:
parent
23a75f43c7
commit
3232fe1d30
3 changed files with 4 additions and 4 deletions
|
@ -79,7 +79,7 @@ void MainLoop()
|
||||||
for(uint16_t idx = 0; idx < sizeof(g_uartStatuses) / sizeof(g_uartStatuses[0]); ++idx) {
|
for(uint16_t idx = 0; idx < sizeof(g_uartStatuses) / sizeof(g_uartStatuses[0]); ++idx) {
|
||||||
if(!g_uartStatuses[idx].txBuffer.busy && send) {
|
if(!g_uartStatuses[idx].txBuffer.busy && send) {
|
||||||
DIAG_ENTER_BUSY();
|
DIAG_ENTER_BUSY();
|
||||||
PostPacket(&g_uartStatuses[idx], text2Send, sizeof(text2Send) - 1 - (rand() & randmask), &g_crcStatus);
|
PostPacket(&g_uartStatuses[idx], text2Send, sizeof(text2Send) - 1 - (rand() & randmask), &g_crcStatus, 1);
|
||||||
DIAG_EXIT_BUSY();
|
DIAG_EXIT_BUSY();
|
||||||
}
|
}
|
||||||
for(uint16_t rIdx = 0; rIdx < 2; ++rIdx)
|
for(uint16_t rIdx = 0; rIdx < 2; ++rIdx)
|
||||||
|
|
|
@ -26,7 +26,7 @@ void InitUartStatus(
|
||||||
|
|
||||||
uint8_t* GetTxBuffer(USARTSTATUS *status);
|
uint8_t* GetTxBuffer(USARTSTATUS *status);
|
||||||
|
|
||||||
uint8_t PostPacket(USARTSTATUS *status, uint8_t const *payload, uint16_t length, struct crcstatus_t *crcStatus);
|
uint8_t PostPacket(USARTSTATUS *status, uint8_t const *payload, uint16_t length, struct crcstatus_t *crcStatus, uint8_t waitForCrcQueue);
|
||||||
void SetupReceive(USARTSTATUS *status);
|
void SetupReceive(USARTSTATUS *status);
|
||||||
void SetupTransmit(USART_TypeDef *usart, DMA_TypeDef* dma, uint32_t stream, void *buffer, uint32_t length);
|
void SetupTransmit(USART_TypeDef *usart, DMA_TypeDef* dma, uint32_t stream, void *buffer, uint32_t length);
|
||||||
void ConsumePacket(USARTSTATUS *status, uint8_t packetIndex);
|
void ConsumePacket(USARTSTATUS *status, uint8_t packetIndex);
|
||||||
|
|
|
@ -91,7 +91,7 @@ static inline uint8_t CheckHeader(USARTPACKET *packet)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
uint8_t PostPacket(USARTSTATUS *status, uint8_t const *payload, uint16_t length, struct crcstatus_t *crcStatus)
|
uint8_t PostPacket(USARTSTATUS *status, uint8_t const *payload, uint16_t length, struct crcstatus_t *crcStatus, uint8_t waitForCrcQueue)
|
||||||
{
|
{
|
||||||
if(length > 256)
|
if(length > 256)
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -113,7 +113,7 @@ uint8_t PostPacket(USARTSTATUS *status, uint8_t const *payload, uint16_t length,
|
||||||
status->txBuffer.error = 0;
|
status->txBuffer.error = 0;
|
||||||
EnqueueCrcTask(status->crcStatus, &status->crcSlot, 0, status->txBuffer.packet.payload, length,
|
EnqueueCrcTask(status->crcStatus, &status->crcSlot, 0, status->txBuffer.packet.payload, length,
|
||||||
NULL, (uint32_t*)(status->txBuffer.packet.payload + payloadLength));
|
NULL, (uint32_t*)(status->txBuffer.packet.payload + payloadLength));
|
||||||
while(IsSlotQueued(&status->crcSlot, 0));
|
while(waitForCrcQueue && IsSlotQueued(&status->crcSlot, 0));
|
||||||
SetupTransmit(status->usart, status->txDmaInfo.dma, status->txDmaInfo.stream, &status->txBuffer.packet, status->txBuffer.requestedLength);
|
SetupTransmit(status->usart, status->txDmaInfo.dma, status->txDmaInfo.stream, &status->txBuffer.packet, status->txBuffer.requestedLength);
|
||||||
|
|
||||||
StatsIncSent(&status->stats);
|
StatsIncSent(&status->stats);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue