You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

29 lines
510 B

/**
* @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;
}