/** * @file port.c * @author Finny (tianjialong0106@163.com) * @brief * @version 0.1 * @date 2022-09-26 * * @copyright Copyright (c) 2022 * */ #include "port.h" #include "driver/gpio.h" #include "esp_log.h" uint32_t port_get_ticket() { return esp_log_timestamp(); } uint32_t port_haspassedms(uint32_t ticket) { return port_get_ticket() - ticket; } uint32_t port_delay_ms(uint32_t ms) { uint32_t now = port_get_ticket(); while (port_get_ticket() - now < ms) { } return 0; }