scsi2sd_time.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. /**
  2. * SCSI2SD V6 - Copyright (C) 2014 Michael McMaster <michael@codesrc.com>
  3. * ZuluSCSI™ - Copyright (c) 2022-2025 Rabbit Hole Computing™
  4. *
  5. * This file is licensed under the GPL version 3 or any later version.  
  6. * It is derived from time.h in SCSI2SD V6.
  7. *
  8. * https://www.gnu.org/licenses/gpl-3.0.html
  9. * ----
  10. * This program is free software: you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License as published by
  12. * the Free Software Foundation, either version 3 of the License, or
  13. * (at your option) any later version. 
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  18. * GNU General Public License for more details. 
  19. *
  20. * You should have received a copy of the GNU General Public License
  21. * along with this program.  If not, see <https://www.gnu.org/licenses/>.
  22. **/
  23. // Timing functions for SCSI2SD.
  24. // This file is derived from time.h in SCSI2SD-V6.
  25. #pragma once
  26. #include <stdint.h>
  27. #include "ZuluSCSI_platform.h"
  28. #define s2s_getTime_ms() millis()
  29. #define s2s_elapsedTime_ms(since) ((uint32_t)(millis() - (since)))
  30. #define s2s_delay_ms(x) delay_ns(x * 1000000)
  31. #define s2s_delay_us(x) delay_ns(x * 1000)
  32. #define s2s_delay_ns(x) delay_ns(x)