Robot
The embedded systems for UTRA's autonomous humanoid soccer-playing robot
|
Helper functions for StartRxTask() More...
![]() |
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... | |
Helper functions for StartRxTask()
This subsection includes helper functions for the StartRXTask() function in freertos.cpp in order to make the the file more readable.
void initializeVars | ( | void | ) |
Initializes the private variables for StartRxTask.
None |
Definition at line 65 of file rx_helper.cpp.
void initiateDMATransfer | ( | void | ) |
Initiates DMA receive transfer using DMA.
None |
Definition at line 82 of file rx_helper.cpp.
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.
None |
Definition at line 129 of file rx_helper.cpp.
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.
None |
Definition at line 112 of file rx_helper.cpp.
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.
None |
Definition at line 95 of file rx_helper.cpp.