Robot
The embedded systems for UTRA's autonomous humanoid soccer-playing robot
StartRxTask Helper Functions

Helper functions for StartRxTask() More...

Collaboration diagram for StartRxTask Helper Functions:

Functions

void initializeVars (void)
 Initializes the private variables for StartRxTask. More...
 
void initiateDMATransfer (void)
 Initiates DMA receive transfer using DMA. More...
 
void waitForNotificationRX (void)
 Waits until notified from ISR. More...
 
void updateStatusToPC (void)
 Makes calls to the UART module responsible for PC communication atomic. More...
 
void receiveDataBuffer (void)
 Reads the received data buffer. More...
 

Detailed Description

Helper functions for StartRxTask()

StartRXTask Helper Functions

This subsection includes helper functions for the StartRXTask() function in freertos.cpp in order to make the the file more readable.

Function Documentation

◆ initializeVars()

void initializeVars ( void  )

Initializes the private variables for StartRxTask.

Parameters
None
Returns
None

Definition at line 65 of file rx_helper.cpp.

Here is the caller graph for this function:

◆ initiateDMATransfer()

void initiateDMATransfer ( void  )

Initiates DMA receive transfer using DMA.

Parameters
None
Returns
None

Definition at line 82 of file rx_helper.cpp.

Here is the caller graph for this function:

◆ receiveDataBuffer()

void receiveDataBuffer ( void  )

Reads the received data buffer.

Once verified that the header sequence is valid and the correct number of bytes are read, the function copies robotGoalData to robotGoal and updates robotGoal id to robotState id. Then, the function wakes up control task and MPU task by notifying.

Parameters
None
Returns
None

Definition at line 129 of file rx_helper.cpp.

Here is the caller graph for this function:

◆ updateStatusToPC()

void updateStatusToPC ( void  )

Makes calls to the UART module responsible for PC communication atomic.

This attempts to solve the following scenario: the TX thread is in the middle of executing the call to HAL_UART_Transmit when suddenly the RX thread is unblocked. The RX thread calls HAL_UART_Receive, and returns immediately when it detects that the UART module is already locked. Then the RX thread blocks itself and never wakes up since a RX transfer was never initialized.

Parameters
None
Returns
None

Definition at line 112 of file rx_helper.cpp.

Here is the caller graph for this function:

◆ waitForNotificationRX()

void waitForNotificationRX ( void  )

Waits until notified from ISR.

This function clears no bits on entry in case the notification comes before this statement is executed (which is rather unlikely as long as this task has the highest priority), but overall this is a better decision in case priorities are changed in the future.

Parameters
None
Returns
None

Definition at line 95 of file rx_helper.cpp.

Here is the caller graph for this function: