This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//https://github.com/STMicroelectronics/STM32CubeF7/blob/master/Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_uart.c | |
HAL_StatusTypeDef UART_WaitOnFlagUntilTimeout(UART_HandleTypeDef *huart, uint32_t Flag, FlagStatus Status, | |
uint32_t Tickstart, uint32_t Timeout) | |
{ | |
/* Wait until flag is set */ | |
while ((__HAL_UART_GET_FLAG(huart, Flag) ? SET : RESET) == Status) | |
{ | |
/* Check for the Timeout */ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Functionality() | |
{ | |
ActivateAsyncBehavior(); | |
msleep(20); //must wait for external behavior to complete | |
ReadDataAndActUponIt(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void GiveProcessingTime() | |
{ | |
//use our unit testing backdoor to service | |
//the active object's internal queue. This avoids threading issues | |
//with unit tests, creating 100% predictable unit tests. | |
while (true == mUnderTest->ProcessOneEvent(ProcessOption::UNIT_TEST)) {} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @brief HwLockCtrlSelfTestResult enumerates possible self test results. | |
*/ | |
typedef enum HwLockCtrlSelfTestResult | |
{ | |
HW_LOCK_CTRL_SELF_TEST_PASSED, | |
HW_LOCK_CTRL_SELF_TEST_FAILED_POWER, | |
HW_LOCK_CTRL_SELF_TEST_FAILED_MOTOR, | |
} HwLockCtrlSelfTestResultT; |