Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Thread 1 (translateToMavlinkThread)

  • Parse messages in the receive buffer (which is also the circular DMA buffer)

Code Block
languagecpp
/**
 * @brief This thread is responsible for taking the bytes from the GSC.DMAReceiveBuffer and
 * converting them to Mavlink messages/triggering the callbacks associated with each mavlink
 * message.
 */
void translateToMavlinkThread()
{
    while (true)
    {
        MT.bytesToMavlinkMsg(GSC.DMAReceiveBuffer);

        vTaskDelay(pdMS_TO_TICKS(10)); // Adjust the delay as necessary
    }
}

Thread 2 (mavlinkToBytesThread)

...

Code Block
languagecpp
/**
 * @brief This thread is responsible for taking data from other managers and converting
 * them to mavlink bytes, then putting them into GSC.lowPriorityTransmitBuffer.
 */
void mavlinkToBytesThread()
{
    while (true)
    {
        // START: fill GSC.lowPriorityTransmitBuffer with data to transmit

        // END: fill GSC.lowPriorityTransmitBuffer with data to transmit

        vTaskDelay(pdMS_TO_TICKS(10)); // Adjust the delay as necessary
    }
}

DMA

  • If the received buffer has space dump bytes into it otherwise disregard the received data

...