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.

17 lines
354 B

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