医美代码重构
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.

11 lines
303 B

3 years ago
  1. #include "port.h"
  2. #include "esp_log.h"
  3. uint32_t port_get_ticket() { return esp_log_timestamp(); }
  4. uint32_t port_haspassedms(uint32_t ticket) { return port_get_ticket() - ticket; }
  5. uint32_t port_delay_ms(uint32_t ms) {
  6. uint32_t now = port_get_ticket();
  7. while (port_get_ticket() - now < ms) {
  8. }
  9. }