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.

28 lines
432 B

  1. /*
  2. * To keep Timer0 for common/timer.c override arduino/wiring.c.
  3. */
  4. #define __DELAY_BACKWARD_COMPATIBLE__
  5. #include "wait.h"
  6. #include "platforms/timer.h"
  7. unsigned long millis(void)
  8. {
  9. return timer_read32();
  10. }
  11. unsigned long micros(void)
  12. {
  13. return timer_read32() * 1000UL;
  14. }
  15. void delay(unsigned long ms)
  16. {
  17. wait_ms(ms);
  18. }
  19. void delayMicroseconds(unsigned int us)
  20. {
  21. wait_us(us);
  22. }
  23. void init(void)
  24. {
  25. timer_init();
  26. }