AWS IoT for ESP32 v1.0.0
An ESP-IDF based solution
lib_delay.h
Go to the documentation of this file.
1/*
2 * lib_delay.h
3 *
4 * Created on: Jun 10, 2021
5 * Author: Saheblal Bagwan
6 */
7
13#ifndef LIB_DELAY_H_
14#define LIB_DELAY_H_
15
16#include "freertos/FreeRTOS.h"
17#include "stdutils.h"
18
19/* Macros -----------------------------------------------------------------*/
20#define MS_TO_RTOS_TICKS(x) ((x) > portTICK_PERIOD_MS ? ((x) / portTICK_PERIOD_MS) : portTICK_PERIOD_MS)
21#define TASK_DELAY_MS(x) vTaskDelay(MS_TO_RTOS_TICKS(x))
22
28uint32_t millis();
29
35int64_t micros();
36
42void delay(uint32_t waitTime_u32);
43
44#endif /* LIB_DELAY_H_ */
void delay(uint32_t waitTime_u32)
Delay, wait until given time period.
int64_t micros()
Get time elapsed in micro seconds since start-up.
uint32_t millis()
Get time elapsed in milli seconds since start-up.