stm32-dht22-CheckResponse

by Marwen Maghrebi
uint8_t check_response(void) {
    TOUT = 0;
    __HAL_TIM_SET_COUNTER(&htim1, 0);
    while (!HAL_GPIO_ReadPin(DHT22_GPIO_Port, DHT22_Pin) && (__HAL_TIM_GET_COUNTER(&htim1) < 100)) {};
    if (__HAL_TIM_GET_COUNTER(&htim1) >= 100)
        return 0;

    __HAL_TIM_SET_COUNTER(&htim1, 0);
    while (HAL_GPIO_ReadPin(DHT22_GPIO_Port, DHT22_Pin) && (__HAL_TIM_GET_COUNTER(&htim1) < 100)) {};
    if (__HAL_TIM_GET_COUNTER(&htim1) >= 100)
        return 0;

    return 1;
}
Are you sure want to unlock this post?
Unlock left : 0
Are you sure want to cancel subscription?
-
00:00
00:00
Update Required Flash plugin
-
00:00
00:00