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
|
@ -26,7 +26,7 @@ void InitUartStatus(
|
|||
|
||||
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 SetupTransmit(USART_TypeDef *usart, DMA_TypeDef* dma, uint32_t stream, void *buffer, uint32_t length);
|
||||
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)
|
||||
return 1;
|
||||
|
@ -113,7 +113,7 @@ uint8_t PostPacket(USARTSTATUS *status, uint8_t const *payload, uint16_t length,
|
|||
status->txBuffer.error = 0;
|
||||
EnqueueCrcTask(status->crcStatus, &status->crcSlot, 0, status->txBuffer.packet.payload, length,
|
||||
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);
|
||||
|
||||
StatsIncSent(&status->stats);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue